Exemplo n.º 1
0
        public static void MarkdownFormat_Constructor_HorizontalRule()
        {
            const HorizontalRuleStyle style = HorizontalRuleStyle.Hyphen;
            const int    count = 3;
            const string space = " ";

            var horizontalRule = new HorizontalRuleFormat(style, count, space);

            var format = new MarkdownFormat(horizontalRuleFormat: horizontalRule);

            Assert.Equal(style, format.HorizontalRuleFormat.Style);
            Assert.Equal(count, format.HorizontalRuleFormat.Count);
            Assert.Equal(space, format.HorizontalRuleFormat.Separator);
        }
        public void HorizontalRuleFormat()
        {
            //ExStart:HorizontalRuleFormat
            DocumentBuilder builder = new DocumentBuilder();

            Shape shape = builder.InsertHorizontalRule();

            HorizontalRuleFormat horizontalRuleFormat = shape.HorizontalRuleFormat;

            horizontalRuleFormat.Alignment    = HorizontalRuleAlignment.Center;
            horizontalRuleFormat.WidthPercent = 70;
            horizontalRuleFormat.Height       = 3;
            horizontalRuleFormat.Color        = Color.Blue;
            horizontalRuleFormat.NoShade      = true;

            builder.Document.Save(ArtifactsDir + "AddContentUsingDocumentBuilder.HorizontalRuleFormat.docx");
            //ExEnd:HorizontalRuleFormat
        }
        public static void DocumentBuilderHorizontalRuleFormat(string dataDir)
        {
            // ExStart:DocumentBuilderHorizontalRuleFormat
            DocumentBuilder builder = new DocumentBuilder();

            Shape shape = builder.InsertHorizontalRule();
            HorizontalRuleFormat horizontalRuleFormat = shape.HorizontalRuleFormat;

            horizontalRuleFormat.Alignment    = HorizontalRuleAlignment.Center;
            horizontalRuleFormat.WidthPercent = 70;
            horizontalRuleFormat.Height       = 3;
            horizontalRuleFormat.Color        = Color.Blue;
            horizontalRuleFormat.NoShade      = true;

            builder.Document.Save("HorizontalRuleFormat.docx");
            // ExEnd:DocumentBuilderHorizontalRuleFormat
            Console.WriteLine("\nHorizontal rule format inserted into document successfully.\nFile saved at " + dataDir);
        }