Share via


ParagraphNode.AlignmentLevel Property

Gets and sets an integer that represents how this paragraph is aligned with other paragraphs in their parent WritingRegionNode object.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)

Syntax

'Declaration
Public Property AlignmentLevel As Integer
'Usage
Dim instance As ParagraphNode 
Dim value As Integer 

value = instance.AlignmentLevel

instance.AlignmentLevel = value
public int AlignmentLevel { get; set; }
public:
property int AlignmentLevel {
    int get ();
    void set (int value);
}
public function get AlignmentLevel () : int 
public function set AlignmentLevel (value : int)

Property Value

Type: System.Int32
The integer that represents how this paragraph is aligned with other paragraphs in their parent WritingRegionNode object.

Remarks

The AlignmentLevel property is often used to indicate level of indentation. For example, if the ink represents an outline, then each line is likely to be a ParagraphNode object, and the AlignmentLevel value is expected to be 0 for the first level of indentation, 1 for the next level, and so forth.

See conceptual topic on WritingRegion and AlignmentLevel for more information.

Examples

The following example takes a ParagraphNode object, selectedParagraph, and fills an ArrayList, alignedParagraphs, with all other ParagraphNode objects in the same WritingRegionNode that have the same AlignmentLevel value.

Dim alignedParagraphs As New ArrayList()
Dim paragraphParent As ContextNode = selectedParagraph.ParentNode
Dim childNode As ContextNode
For Each childNode In paragraphParent.SubNodes
    If TypeOf childNode Is ParagraphNode Then 
        Dim paragraph As ParagraphNode = childNode
        If paragraph.AlignmentLevel = selectedParagraph.AlignmentLevel Then
            alignedParagraphs.Add(paragraph)
        End If 
    End If 
Next childNode
ArrayList alignedParagraphs = new ArrayList();
ContextNode paragraphParent = selectedParagraph.ParentNode;
foreach (ContextNode childNode in paragraphParent.SubNodes)
{
    if (childNode is ParagraphNode)
    {
        ParagraphNode paragraph = (ParagraphNode)childNode;
        if (paragraph.AlignmentLevel == selectedParagraph.AlignmentLevel)
        {
            alignedParagraphs.Add(paragraph);
        }
    }
}

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

ParagraphNode Class

ParagraphNode Members

Microsoft.Ink Namespace