Skip to content

Commit e789462

Browse files
Serhii PuchokSerhii Puchok
Serhii Puchok
authored and
Serhii Puchok
committed
Updated w.r.t 21.6
1 parent 0e54438 commit e789462

File tree

7 files changed

+105
-6
lines changed

7 files changed

+105
-6
lines changed

Examples/CSharp/CSharp.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@
5454
<StartupObject>Aspose.Slides.Examples.CSharp.RunExamples</StartupObject>
5555
</PropertyGroup>
5656
<ItemGroup>
57-
<Reference Include="Aspose.Cells, Version=21.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
57+
<Reference Include="Aspose.Cells, Version=21.6.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
5858
<SpecificVersion>False</SpecificVersion>
59-
<HintPath>..\packages\Aspose.Cells.21.5.0\lib\net40\Aspose.Cells.dll</HintPath>
59+
<HintPath>..\packages\Aspose.Cells.21.6.0\lib\net40\Aspose.Cells.dll</HintPath>
6060
</Reference>
61-
<Reference Include="Aspose.Slides, Version=21.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
61+
<Reference Include="Aspose.Slides, Version=21.6.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
6262
<SpecificVersion>False</SpecificVersion>
63-
<HintPath>..\packages\Aspose.Slides.NET.21.5.0\lib\net4.0-client\Aspose.Slides.dll</HintPath>
63+
<HintPath>..\packages\Aspose.Slides.NET.21.6.0\lib\net4.0-client\Aspose.Slides.dll</HintPath>
6464
</Reference>
6565
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
6666
<SpecificVersion>False</SpecificVersion>
@@ -115,6 +115,7 @@
115115
<Compile Include="Charts\SetExternalWorkbookWithUpdateChartData.cs" />
116116
<Compile Include="Charts\SetExternalWorkbookFromNetwork.cs" />
117117
<Compile Include="Charts\SpreadsheetFormulasOptions.cs" />
118+
<Compile Include="Presentations\Conversion\ConvertToXaml.cs" />
118119
<Compile Include="Presentations\Conversion\ExportMathParagraphToMathML.cs" />
119120
<Compile Include="Presentations\Conversion\FodpFormatConvertion.cs" />
120121
<Compile Include="Presentations\Conversion\MailMergeExample.cs" />
@@ -131,6 +132,7 @@
131132
<Compile Include="Rendering-Printing\Rendering3D.cs" />
132133
<Compile Include="Rendering-Printing\RenderOptions.cs" />
133134
<Compile Include="Rendering-Printing\SupportOfDigitalSignature.cs" />
135+
<Compile Include="Shapes\AnimationTargetShapes.cs" />
134136
<Compile Include="Shapes\CreateSummaryZoom.cs" />
135137
<Compile Include="Shapes\CreateZoomFrame.cs" />
136138
<Compile Include="Shapes\ExtractEmbeddedFileDataFromOLEObject.cs" />
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
using System.Collections.Generic;
2+
using System.IO;
3+
using System.Text;
4+
using Aspose.Slides.Export;
5+
using Aspose.Slides.Export.Xaml;
6+
7+
/*
8+
This example demonstrates how to export a Presentation to a set of XAML files.
9+
*/
10+
11+
namespace Aspose.Slides.Examples.CSharp.Presentations.Conversion
12+
{
13+
public class ConvertToXaml
14+
{
15+
public static void Run()
16+
{
17+
// Path to source presentation
18+
string presentationFileName = Path.Combine(RunExamples.GetDataDir_Conversion(), "XamlEtalon.pptx");
19+
20+
using (Presentation pres = new Presentation(presentationFileName))
21+
{
22+
// Create convertion options
23+
XamlOptions xamlOptions = new XamlOptions();
24+
xamlOptions.ExportHiddenSlides = true;
25+
26+
// Define your own output-saving service
27+
NewXamlSaver newXamlSaver = new NewXamlSaver();
28+
xamlOptions.OutputSaver = newXamlSaver;
29+
30+
// Convert slides
31+
pres.Save(xamlOptions);
32+
33+
// Save XAML files to an output directory
34+
foreach (var pair in newXamlSaver.Results)
35+
{
36+
File.AppendAllText(Path.Combine(RunExamples.OutPath, pair.Key), pair.Value);
37+
}
38+
}
39+
}
40+
41+
/// <summary>
42+
/// Represents an output saver implementation for transfer data to the external storage.
43+
/// </summary>
44+
class NewXamlSaver : IXamlOutputSaver
45+
{
46+
private Dictionary<string, string> m_result = new Dictionary<string, string>();
47+
48+
public Dictionary<string, string> Results
49+
{
50+
get { return m_result; }
51+
}
52+
53+
public void Save(string path, byte[] data)
54+
{
55+
string name = Path.GetFileName(path);
56+
Results[name] = Encoding.UTF8.GetString(data);
57+
}
58+
}
59+
}
60+
}

Examples/CSharp/RunExamples.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ public static void Main()
185185
//SvgFormattingController.Run();
186186
//MailMergeExample.Run();
187187
//PdfImportExample.Run();
188+
//ConvertToXaml.Run();
188189

189190
// =====================================================
190191
//// =====================================================
@@ -297,6 +298,7 @@ public static void Main()
297298
//GeometryShapeUsingShapeUtil.Run();
298299
//CreateZoomFrame.Run();
299300
//CreateSummaryZoom.Run();
301+
//AnimationTargetShapes.Run();
300302

301303
//// =====================================================
302304
//// Slides
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System;
2+
using System.IO;
3+
using Aspose.Slides;
4+
using Aspose.Slides.Animation;
5+
using Aspose.Slides.DOM.Ole;
6+
using Aspose.Slides.Export;
7+
8+
/*
9+
This sample demonstrates the output of information for all animated shapes in the main sequence for all slides in a presentation.
10+
*/
11+
12+
namespace Aspose.Slides.Examples.CSharp.Shapes
13+
{
14+
public class AnimationTargetShapes
15+
{
16+
public static void Run()
17+
{
18+
// Path to source presentation
19+
string presentationFileName = Path.Combine(RunExamples.GetDataDir_Shapes(), "AnimationShapesExample.pptx");
20+
21+
using (Presentation pres = new Presentation(presentationFileName))
22+
{
23+
foreach (ISlide slide in pres.Slides)
24+
{
25+
foreach (IEffect effect in slide.Timeline.MainSequence)
26+
{
27+
Console.WriteLine(effect.Type + " animation effect is set to shape#" +
28+
effect.TargetShape.UniqueId +
29+
" on slide#" + slide.SlideNumber);
30+
}
31+
}
32+
}
33+
}
34+
}
35+
}

Examples/CSharp/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Aspose.Cells" version="21.5.0" targetFramework="net45" />
4-
<package id="Aspose.Slides.NET" version="21.5.0" targetFramework="net45" />
3+
<package id="Aspose.Cells" version="21.6.0" targetFramework="net45" />
4+
<package id="Aspose.Slides.NET" version="21.6.0" targetFramework="net45" />
55
</packages>
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)