diff --git a/Open-XML-SDK.sln b/Open-XML-SDK.sln index 7520970a5..dd2f78e80 100644 --- a/Open-XML-SDK.sln +++ b/Open-XML-SDK.sln @@ -85,8 +85,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentFormat.OpenXml.Fram EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThreadedCommentExample", "samples\ThreadedCommentExample\ThreadedCommentExample.csproj", "{5241BCF2-331D-428E-A9C4-F8DF92C8F726}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerPointModernCommentSample", "samples\PowerPointModernCommentSample\PowerPointModernCommentSample.csproj", "{3ECC7570-3501-479D-9CD9-64799C2AD149}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SVGExample", "samples\SVGExample\SVGExample.csproj", "{BADAC0CC-F3E6-440E-B322-DA2B97625F26}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RichData", "samples\RichData\RichData.csproj", "{8EE9F34E-EAA1-4F03-B388-8076CE44DD7B}" @@ -181,10 +179,6 @@ Global {5241BCF2-331D-428E-A9C4-F8DF92C8F726}.Debug|Any CPU.Build.0 = Debug|Any CPU {5241BCF2-331D-428E-A9C4-F8DF92C8F726}.Release|Any CPU.ActiveCfg = Release|Any CPU {5241BCF2-331D-428E-A9C4-F8DF92C8F726}.Release|Any CPU.Build.0 = Release|Any CPU - {3ECC7570-3501-479D-9CD9-64799C2AD149}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3ECC7570-3501-479D-9CD9-64799C2AD149}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3ECC7570-3501-479D-9CD9-64799C2AD149}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3ECC7570-3501-479D-9CD9-64799C2AD149}.Release|Any CPU.Build.0 = Release|Any CPU {BADAC0CC-F3E6-440E-B322-DA2B97625F26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BADAC0CC-F3E6-440E-B322-DA2B97625F26}.Debug|Any CPU.Build.0 = Debug|Any CPU {BADAC0CC-F3E6-440E-B322-DA2B97625F26}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -220,7 +214,6 @@ Global {C91489AB-FF14-4FAD-BA51-35371ADD7E1C} = {3653266D-2C88-4487-8977-839CB3E78A0A} {BB5DF535-E849-42AC-852A-A6D4815347C0} = {A4DF60EB-3AA5-48F0-B4D2-3F94B8E62F03} {5241BCF2-331D-428E-A9C4-F8DF92C8F726} = {7DAF7304-40CC-4180-88A5-9A89DD13C565} - {3ECC7570-3501-479D-9CD9-64799C2AD149} = {7DAF7304-40CC-4180-88A5-9A89DD13C565} {BADAC0CC-F3E6-440E-B322-DA2B97625F26} = {7DAF7304-40CC-4180-88A5-9A89DD13C565} {8EE9F34E-EAA1-4F03-B388-8076CE44DD7B} = {7DAF7304-40CC-4180-88A5-9A89DD13C565} EndGlobalSection diff --git a/samples/PowerPointModernCommentSample/PowerPointModernCommentSample.csproj b/samples/PowerPointModernCommentSample/PowerPointModernCommentSample.csproj deleted file mode 100644 index e6c35ecaf..000000000 --- a/samples/PowerPointModernCommentSample/PowerPointModernCommentSample.csproj +++ /dev/null @@ -1 +0,0 @@ - diff --git a/samples/PowerPointModernCommentSample/Program.cs b/samples/PowerPointModernCommentSample/Program.cs deleted file mode 100644 index 3224eb959..000000000 --- a/samples/PowerPointModernCommentSample/Program.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Common; -using DocumentFormat.OpenXml; -using DocumentFormat.OpenXml.Drawing; -using DocumentFormat.OpenXml.Office2016.Presentation.Command; -using DocumentFormat.OpenXml.Office2021.PowerPoint.Comment; -using DocumentFormat.OpenXml.Packaging; -using DocumentFormat.OpenXml.Presentation; -using System; -using System.IO; -using System.Linq; - -using Comment = DocumentFormat.OpenXml.Office2021.PowerPoint.Comment.Comment; -using CommentList = DocumentFormat.OpenXml.Office2021.PowerPoint.Comment.CommentList; -using Text = DocumentFormat.OpenXml.Drawing.Text; - -namespace PowerPointModernCommentSample -{ - internal class Program - { - public static void Main(string[] args) - { - try - { - if (args.Length == 0) - { - Console.WriteLine("Usage: PowerPointModernCommentSample.exe "); - return; - } - - FileInfo fileInfo = new FileInfo(args[0]); - - if (fileInfo.Exists) - { - fileInfo.Delete(); - } - - // Create a presentation - using PresentationDocument presentationDocument = PowerPointUtils.CreatePresentation(fileInfo.FullName); - - // create missing PowerPointAuthorsPart if it is null - if (presentationDocument?.PresentationPart?.authorsPart is null) - { - presentationDocument?.PresentationPart.AddNewPart(); - } - - // Add missing AuthorList if it is null - if (presentationDocument?.PresentationPart?.authorsPart?.AuthorList is null) - { - presentationDocument.PresentationPart.authorsPart.AuthorList = new AuthorList(); - } - - // In production you will need to retrieve actual user information - string authorId = string.Concat("{", Guid.NewGuid(), "}"); - presentationDocument.PresentationPart.authorsPart.AuthorList.AddChild(new Author() - { Id = authorId, Name = "Jose Contoso", Initials = "JC", UserId = "jose@contosot.com::9ed1aa81-8d9b-4a15-b989-8cbbfd4c4b3e", ProviderId = "AD" }); - - // Get the Id of the slide to add the comment to - SlideId slideId = presentationDocument.PresentationPart.Presentation.SlideIdList.Elements().First(); - - Random ran = new Random(); - UInt32Value cid = Convert.ToUInt32(ran.Next(100000000, 999999999)); - - // Add a comment to the slide - PowerPointCommentPart powerPointCommentPart = presentationDocument.PresentationPart.SlideParts.First().AddNewPart(); - - powerPointCommentPart.CommentList = new CommentList( - new Comment( - new SlideMonikerList( - new DocumentMoniker(), - new SlideMoniker() - { - CId = cid, - SldId = slideId.Id, - }), - new TextBodyType( - new BodyProperties(), - new ListStyle(), - new Paragraph(new Run(new Text("Hello World!"))))) - { - Id = string.Concat("{", Guid.NewGuid(), "}"), - AuthorId = authorId, - Created = DateTime.Now, - }); - - SlidePart slidePart = presentationDocument.PresentationPart.SlideParts.First(); - Slide slide = slidePart.Slide; - - slide.AppendChild( - new PresentationExtensionList( - new PresentationExtension( - new CommentRelationship() - { Id = slidePart.GetIdOfPart(powerPointCommentPart) }) - { Uri = "{6950BFC3-D8DA-4A85-94F7-54DA5524770B}" })); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - } - } - } -} diff --git a/samples/PowerPointModernCommentSample/Properties/launchSettings.json b/samples/PowerPointModernCommentSample/Properties/launchSettings.json deleted file mode 100644 index d3bfe97c7..000000000 --- a/samples/PowerPointModernCommentSample/Properties/launchSettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "profiles": { - "PowerPointCommentSample": { - "commandName": "Project", - "commandLineArgs": "C:\\source\\deleteThis\\foobar\\test.pptx" - } - } -} \ No newline at end of file