Click or drag to resize

Inline Class

Represents a base class for all inline elements.
Inheritance Hierarchy

Namespace:  SautinSoft.Document
Assembly:  SautinSoft.Document (in SautinSoft.Document.dll) Version: 3.7.4.3 (3.7.4.3)
Syntax
public abstract class Inline : Element

The Inline type exposes the following members.

Properties
  NameDescription
Public propertyContent
Gets the ContentRange of the current element.
(Inherited from Element.)
Public propertyDocument
Gets the owner document.
(Inherited from Element.)
Public propertyElementType
Gets the ElementType of this element instance.
(Inherited from Element.)
Public propertyNextSibling
Gets the next Element sibling.
(Inherited from Element.)
Public propertyParent
Gets the parent of this element instance.
(Inherited from Element.)
Public propertyParentCollection
Gets the InlineCollection that contains this Inline instance.
Public propertyPreviuosSibling
Gets the previous Element sibling.
(Inherited from Element.)
Top
Methods
  NameDescription
Public methodCode exampleClone
Clones this element instance.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodCode exampleGetChildElements(Boolean)
Gets the child elements.
(Inherited from Element.)
Public methodCode exampleGetChildElements(Boolean, ElementType)
Gets the child elements filtered by ElementType.
(Inherited from Element.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Examples
How to create a simple document with text in C#
using SautinSoft.Document;

namespace Sample
{
    class Sample
    {
        static void Main(string[] args)
        {
            AddText();
        }

        /// <summary>
        /// How to create a simple document with text. 
        /// </summary>
        /// <remarks>
        /// Details: https://sautinsoft.com/products/document/examples/text.php
        /// </remarks>
        public static void AddText()
        {
            string documentPath = @"Text.docx";

            // Let's create a new document.
            DocumentCore dc = new DocumentCore();

            // Create a new section and add into the document.
            Section section = new Section(dc);
            dc.Sections.Add(section);

            // Create a new paragraph and add into the section.
            Paragraph par = new Paragraph(dc);
            section.Blocks.Add(par);

            // Create Inline-derived objects with text.
            Run run1 = new Run(dc, "This is a rich");
            run1.CharacterFormat = new CharacterFormat() { FontName = "Times New Roman", Size = 18.0, FontColor = new Color(112, 173, 71) };

            Run run2 = new Run(dc, " formatted text");
            run2.CharacterFormat = new CharacterFormat() { FontName = "Arial", Size = 10.0, FontColor = new Color("#0070C0") };

            SpecialCharacter spch3 = new SpecialCharacter(dc, SpecialCharacterType.LineBreak);

            Run run4 = new Run(dc, "with a line break.");
            run4.CharacterFormat = new CharacterFormat() { FontName = "Times New Roman", Size = 10.0, FontColor = Color.Black };

            // Add our inlines into the paragraph.
            par.Inlines.Add(run1);
            par.Inlines.Add(run2);
            par.Inlines.Add(spch3);
            par.Inlines.Add(run4);

            // Save our document into the DOCX format.
            dc.Save(documentPath);

            // Open the result for demonstation purposes.
            System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(documentPath) { UseShellExecute = true });
        }
    }
}
How to create a simple document with text in VB.Net
Imports System
Imports System.IO
Imports SautinSoft.Document

Module Sample
    Sub Main()
        AddText()
    End Sub

    ''' <summary>
    ''' How to create a simple document with text. 
    ''' </summary>
    ''' <remarks>
    ''' Details: https://sautinsoft.com/products/document/examples/text.php
    ''' </remarks>
    Sub AddText()
        Dim documentPath As String = "Text.docx"

        ' Let's create a new document.
        Dim dc As New DocumentCore()

        ' Create a new section and add into the document.
        Dim section As New Section(dc)
        dc.Sections.Add(section)

        ' Create a new paragraph and add into the section.
        Dim par As New Paragraph(dc)
        section.Blocks.Add(par)

        ' Create Inline-derived objects with text.
        Dim run1 As New Run(dc, "This is a rich")
        run1.CharacterFormat = New CharacterFormat() With {
            .FontName = "Times New Roman",
            .Size = 18.0,
            .FontColor = New Color(112, 173, 71)
        }

        Dim run2 As New Run(dc, " formatted text")
        run2.CharacterFormat = New CharacterFormat() With {
            .FontName = "Arial",
            .Size = 10.0,
            .FontColor = New Color("#0070C0")
        }

        Dim spch3 As New SpecialCharacter(dc, SpecialCharacterType.LineBreak)

        Dim run4 As New Run(dc, "with a line break.")
        run4.CharacterFormat = New CharacterFormat() With {
            .FontName = "Times New Roman",
            .Size = 10.0,
            .FontColor = Color.Black
        }

        ' Add our inlines into the paragraph.
        par.Inlines.Add(run1)
        par.Inlines.Add(run2)
        par.Inlines.Add(spch3)
        par.Inlines.Add(run4)

        ' Save our document into the DOCX format.
        dc.Save(documentPath)

        ' Open the result for demonstation purposes.
        System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(documentPath) With {.UseShellExecute = True})
    End Sub
End Module
See Also
Inheritance Hierarchy