ApiExamples.ExDocument.GetShapeAltTextTitle C# (CSharp) Метод

GetShapeAltTextTitle() приватный Метод

private GetShapeAltTextTitle ( ) : void
Результат void
        public void GetShapeAltTextTitle()
        {
            //ExStart
            //ExFor:Shape.Title
            //ExSummary:Shows how to get or set alt text title for shape object
            Document doc = new Document();

            // Create textbox shape.
            Shape shape = new Shape(doc, ShapeType.Cube);
            shape.Width = 431.5;
            shape.Height = 346.35;
            shape.Title = "Alt Text Title";

            Paragraph paragraph = new Paragraph(doc);
            paragraph.AppendChild(new Run(doc, "Test"));

            // Insert paragraph into the textbox.
            shape.AppendChild(paragraph);

            // Insert textbox into the document.
            doc.FirstSection.Body.FirstParagraph.AppendChild(shape);
            
            MemoryStream dstStream = new MemoryStream();
            doc.Save(dstStream, SaveFormat.Docx);

            Node[] shapes = doc.GetChildNodes(NodeType.Shape, true).ToArray();
            shape = (Shape)shapes[0];

            Assert.AreEqual("Alt Text Title", shape.Title);
            //ExEnd
        }
ExDocument