Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

Program.cs 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /***************************************************************************************
  2. DocX – DocX is the community edition of Xceed Words for .NET
  3. Copyright (C) 2009-2017 Xceed Software Inc.
  4. This program is provided to you under the terms of the Microsoft Public
  5. License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
  6. For more features and fast professional support,
  7. pick up Xceed Words for .NET at https://xceed.com/xceed-words-for-net/
  8. *************************************************************************************/
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Threading;
  12. namespace Xceed.Words.NET.Examples
  13. {
  14. public class Program
  15. {
  16. internal const string SampleDirectory = @"..\..\Samples\";
  17. private static void Main( string[] args )
  18. {
  19. Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo( "en-US" );
  20. //Paragraphs
  21. ParagraphSample.SimpleFormattedParagraphs();
  22. ParagraphSample.ForceParagraphOnSinglePage();
  23. ParagraphSample.ForceMultiParagraphsOnSinglePage();
  24. ParagraphSample.TextActions();
  25. ParagraphSample.Heading();
  26. //Document
  27. DocumentSample.AddCustomProperties();
  28. DocumentSample.ReplaceText();
  29. DocumentSample.ApplyTemplate();
  30. DocumentSample.AppendDocument();
  31. //Images
  32. ImageSample.AddPicture();
  33. ImageSample.CopyPicture();
  34. ImageSample.ModifyImage();
  35. //Indentation/Direction/Margins
  36. MarginSample.SetDirection();
  37. MarginSample.Indentation();
  38. MarginSample.Margins();
  39. //Header/Footers
  40. HeaderFooterSample.HeadersFooters();
  41. //Tables
  42. TableSample.InsertRowAndImageTable();
  43. TableSample.TextDirectionTable();
  44. TableSample.CreateRowsFromTemplate();
  45. TableSample.ColumnsWidth();
  46. TableSample.MergeCells();
  47. //Hyperlink
  48. HyperlinkSample.Hyperlinks();
  49. //Section
  50. SectionSample.InsertSections();
  51. //Lists
  52. ListSample.AddList();
  53. //Equations
  54. EquationSample.InsertEquation();
  55. //Bookmarks
  56. BookmarkSample.InsertBookmarks();
  57. BookmarkSample.ReplaceText();
  58. //Charts
  59. ChartSample.BarChart();
  60. ChartSample.LineChart();
  61. ChartSample.PieChart();
  62. ChartSample.Chart3D();
  63. //Tale of Content
  64. TableOfContentSample.InsertTableOfContent();
  65. TableOfContentSample.InsertTableOfContentWithReference();
  66. //Lines
  67. LineSample.InsertHorizontalLine();
  68. //Protection
  69. ProtectionSample.AddPasswordProtection();
  70. ProtectionSample.AddProtection();
  71. //Parallel
  72. ParallelSample.DoParallelActions();
  73. //Others
  74. MiscellaneousSample.CreateRecipe();
  75. MiscellaneousSample.CompanyReport();
  76. MiscellaneousSample.CreateInvoice();
  77. Console.WriteLine( "\nPress any key to exit." );
  78. Console.ReadKey();
  79. }
  80. #region Charts
  81. private class ChartData
  82. {
  83. public String Mounth
  84. {
  85. get; set;
  86. }
  87. public Double Money
  88. {
  89. get; set;
  90. }
  91. public static List<ChartData> CreateCompanyList1()
  92. {
  93. List<ChartData> company1 = new List<ChartData>();
  94. company1.Add( new ChartData() { Mounth = "January", Money = 100 } );
  95. company1.Add( new ChartData() { Mounth = "February", Money = 120 } );
  96. company1.Add( new ChartData() { Mounth = "March", Money = 140 } );
  97. return company1;
  98. }
  99. public static List<ChartData> CreateCompanyList2()
  100. {
  101. List<ChartData> company2 = new List<ChartData>();
  102. company2.Add( new ChartData() { Mounth = "January", Money = 80 } );
  103. company2.Add( new ChartData() { Mounth = "February", Money = 160 } );
  104. company2.Add( new ChartData() { Mounth = "March", Money = 130 } );
  105. return company2;
  106. }
  107. }
  108. #endregion
  109. }
  110. }