Share via


ParagraphNode.AlignmentLevel Property

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

Namespace:  System.Windows.Ink
Assembly:  IAWinFX (in IAWinFX.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 the current paragraph is aligned with other paragraphs in their parent WritingRegionNode object.

Remarks

You can use the AlignmentLevel property as an indication of the 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.

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

For Each childNode As ContextNode In paragraphParent.SubNodes
    If TypeOf childNode Is ParagraphNode Then 
        Dim paragraph As ParagraphNode = CType(childNode, ParagraphNode)
        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 XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

System.Windows.Ink Namespace