다음을 통해 공유


ContextNodeBase.DeleteSubNode 메서드

업데이트: 2007년 11월

자식 ContextNodeBase 개체를 삭제합니다.

네임스페이스:  System.Windows.Ink.AnalysisCore
어셈블리:  IACore(IACore.dll)

구문

‘선언
Public Sub DeleteSubNode ( _
    node As ContextNodeBase _
)
‘사용 방법
Dim instance As ContextNodeBase
Dim node As ContextNodeBase

instance.DeleteSubNode(node)
public void DeleteSubNode(
    ContextNodeBase node
)
public:
void DeleteSubNode(
    ContextNodeBase^ node
)
public void DeleteSubNode(
    ContextNodeBase node
)
public function DeleteSubNode(
    node : ContextNodeBase
)

매개 변수

설명

노드가 비어 있지 않으면 예외가 throw됩니다. node가 이 ContextNodeBase 개체의 자식이 아니면 ArgumentException이 throw됩니다.

예제

이 예제에서는 모든 줄을 가져와 별도의 자체 단락에 배치합니다. 이름이 theInkAnalyzerBase;인 InkAnalyzerBase의 줄을 사용하여 각각에 대해 새 단락 하위 노드를 만들고 줄의 부모를 이 새 단락으로 재지정한 다음 원래 단락을 삭제합니다.

' Take each line and make it its own paragraph
Dim originalParagraphs As ContextNodeBaseCollection = _
    theInkAnalyzerBase.FindNodesOfType(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Paragraph)
Dim lines As ContextNodeBaseCollection = _
    theInkAnalyzerBase.FindNodesOfType(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Line)
Dim lineNode As ContextNodeBase
For Each lineNode In lines
    ' Create a new alignment level and paragraph
    Dim lineParagraph As ContextNodeBase = lineNode.ParentNode
    Dim writingRegion As ContextNodeBase = lineParagraph.ParentNode
    Dim newParagraph As ContextNodeBase = _
        writingRegion.CreateSubNode(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Paragraph)
    ' Reparent the line
    lineNode.Reparent(newParagraph)
Next lineNode
' Remove original paragraphs and alignment nodes
Dim originalParagraph As ContextNodeBase
For Each originalParagraph In originalParagraphs
    Dim originalAlignmentLevel As ContextNodeBase = originalParagraph.ParentNode
    originalAlignmentLevel.DeleteSubNode(originalParagraph)
    originalAlignmentLevel.ParentNode.DeleteSubNode(originalAlignmentLevel)
Next originalParagraph
// Take each line and make it its own paragraph
ContextNodeBaseCollection originalParagraphs =
    theInkAnalyzerBase.FindNodesOfType(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Paragraph);
ContextNodeBaseCollection lines =
    theInkAnalyzerBase.FindNodesOfType(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Line);
foreach (ContextNodeBase lineNode in lines)
{
    // Create a new paragraph
    ContextNodeBase paragraph = lineNode.ParentNode;
    ContextNodeBase writingRegion = paragraph.ParentNode;
    ContextNodeBase newParagraph =
        writingRegion.CreateSubNode(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Paragraph);
    // Reparent the line
    lineNode.Reparent(newParagraph);
}
// Remove original paragraphs 
foreach (ContextNodeBase originalParagraph in originalParagraphs)
{
    ContextNodeBase originalWritingRegion = originalParagraph.ParentNode;
    originalWritingRegion.DeleteSubNode(originalParagraph);
}

플랫폼

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

ContextNodeBase 클래스

ContextNodeBase 멤버

System.Windows.Ink.AnalysisCore 네임스페이스

ContextNodeBase.CreateSubNode