diff --git a/Create-Markdown-document/.NET/Create-Markdown-document.sln b/Create-Markdown-document/.NET/Create-Markdown-document.sln new file mode 100644 index 0000000..a27c4a5 --- /dev/null +++ b/Create-Markdown-document/.NET/Create-Markdown-document.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.37516.0 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Create-Markdown-document", "Create-Markdown-document\Create-Markdown-document.csproj", "{464D1C4F-8780-F241-6A1E-B6405776F727}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {464D1C4F-8780-F241-6A1E-B6405776F727}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {464D1C4F-8780-F241-6A1E-B6405776F727}.Debug|Any CPU.Build.0 = Debug|Any CPU + {464D1C4F-8780-F241-6A1E-B6405776F727}.Release|Any CPU.ActiveCfg = Release|Any CPU + {464D1C4F-8780-F241-6A1E-B6405776F727}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7CB67246-8DAB-42FB-8FAF-C8881909D00A} + EndGlobalSection +EndGlobal diff --git a/Create-Markdown-document/.NET/Create-Markdown-document/Create-Markdown-document.csproj b/Create-Markdown-document/.NET/Create-Markdown-document/Create-Markdown-document.csproj new file mode 100644 index 0000000..9bb8cc6 --- /dev/null +++ b/Create-Markdown-document/.NET/Create-Markdown-document/Create-Markdown-document.csproj @@ -0,0 +1,24 @@ + + + + Exe + net8.0 + Create_Markdown_document + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/Create-Markdown-document/.NET/Create-Markdown-document/Data/photo.jpg b/Create-Markdown-document/.NET/Create-Markdown-document/Data/photo.jpg new file mode 100644 index 0000000..86f87c5 Binary files /dev/null and b/Create-Markdown-document/.NET/Create-Markdown-document/Data/photo.jpg differ diff --git a/Create-Markdown-document/.NET/Create-Markdown-document/Output/.gitkeep b/Create-Markdown-document/.NET/Create-Markdown-document/Output/.gitkeep new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/Create-Markdown-document/.NET/Create-Markdown-document/Output/.gitkeep @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Create-Markdown-document/.NET/Create-Markdown-document/Output/Output.md b/Create-Markdown-document/.NET/Create-Markdown-document/Output/Output.md new file mode 100644 index 0000000..5e4de14 --- /dev/null +++ b/Create-Markdown-document/.NET/Create-Markdown-document/Output/Output.md @@ -0,0 +1,18 @@ +**Created with a trial version of Syncfusion Markdown library or registered the wrong key in your application. Click** [**here**](https://www.syncfusion.com/account/claim-license-key?pl=bWFya2Rvd24sd3BmLHdpbnVp&vs=MzQuMS4zMw==) **to obtain the valid key.** + +# Adventure Works Cycles + +Adventure Works Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company. The company manufactures and sells metal and composite bicycles to North American, European and Asian commercial markets. While its base operation is in Bothell, Washington with 290 employees, several regional sales teams are located throughout their market base. + +- First item + +- Second item + +- Third item + +|Profile picture|Description| +|:---|:---| +|![Profile picture](Data\photo.jpg)|AdventureWorks Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company.| + + +**Created with a trial version of Syncfusion Markdown library or registered the wrong key in your application. Click** [**here**](https://www.syncfusion.com/account/claim-license-key?pl=bWFya2Rvd24sd3BmLHdpbnVp&vs=MzQuMS4zMw==) **to obtain the valid key.** \ No newline at end of file diff --git a/Create-Markdown-document/.NET/Create-Markdown-document/Program.cs b/Create-Markdown-document/.NET/Create-Markdown-document/Program.cs new file mode 100644 index 0000000..550e2e2 --- /dev/null +++ b/Create-Markdown-document/.NET/Create-Markdown-document/Program.cs @@ -0,0 +1,69 @@ +using Syncfusion.Office.Markdown; +using System.Text; + +namespace Create_Markdown_document +{ + class Program + { + static void Main(string[] args) + { + // Creates a new instance of MarkdownDocument. + MarkdownDocument markdownDocument = new MarkdownDocument(); + // Adds a heading to the Markdown document. + MdParagraph mdHeadingParagraph = markdownDocument.AddParagraph(); + // Applies the Heading 1 style to the paragraph. + mdHeadingParagraph.ApplyParagraphStyle("Heading 1"); + MdTextRange mdHeadingTextRange = mdHeadingParagraph.AddTextRange(); + mdHeadingTextRange.Text = "Adventure Works Cycles"; + // Adds a paragraph to the Markdown document. + MdParagraph mdParagraph = markdownDocument.AddParagraph(); + MdTextRange mdTextRange = mdParagraph.AddTextRange(); + mdTextRange.Text = "Adventure Works Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company. The company manufactures and sells metal and composite bicycles to North American, European and Asian commercial markets. While its base operation is in Bothell, Washington with 290 employees, several regional sales teams are located throughout their market base."; + // Adds the first list item. + MdParagraph item1 = markdownDocument.AddParagraph(); + item1.ListFormat = new MdListFormat(); + item1.ListFormat.IsNumbered = false; + item1.ListFormat.ListLevel = 0; + item1.ListFormat.ListValue = "- "; + item1.AddTextRange().Text = "First item"; + // Adds the second list item. + MdParagraph item2 = markdownDocument.AddParagraph(); + item2.ListFormat = new MdListFormat(); + item2.ListFormat.IsNumbered = false; + item2.ListFormat.ListLevel = 0; + item2.ListFormat.ListValue = "- "; + item2.AddTextRange().Text = "Second item"; + // Adds the third list item. + MdParagraph item3 = markdownDocument.AddParagraph(); + item3.ListFormat = new MdListFormat(); + item3.ListFormat.IsNumbered = false; + item3.ListFormat.ListLevel = 0; + item3.ListFormat.ListValue = "- "; + item3.AddTextRange().Text = "Third item"; + // Adds a table to the Markdown document. + MdTable table = markdownDocument.AddTable(); + table.ColumnAlignments.Add(MdColumnAlignment.Left); + table.ColumnAlignments.Add(MdColumnAlignment.Left); + // Adds the header row. + MdTableRow headerRow = table.AddTableRow(); + MdTableCell header1 = headerRow.AddTableCell(); + header1.Items.Add(new MdTextRange { Text = "Profile picture" }); + MdTableCell header2 = headerRow.AddTableCell(); + header2.Items.Add(new MdTextRange { Text = "Description" }); + + // Adds a data row. + MdTableRow dataRow = table.AddTableRow(); + MdTableCell cell1 = dataRow.AddTableCell(); + MdPicture picture = new MdPicture(); + picture.Url = "Data\\photo.jpg"; + picture.AltText = "Profile picture"; + cell1.Items.Add(picture); + MdTableCell cell2 = dataRow.AddTableCell(); + cell2.Items.Add(new MdTextRange { Text = "AdventureWorks Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company." }); + // Saves the Markdown document to the file system + markdownDocument.Save(Path.GetFullPath("Output/Output.md")); + // Disposes the document to release all memory + markdownDocument.Dispose(); + } + } +}