ContextNode.ReparentStrokes 메서드
업데이트: 2007년 11월
이 ContextNode 개체에서 지정된 ContextNode 개체로 스트로크를 이동합니다.
네임스페이스: System.Windows.Ink
어셈블리: IAWinFX(IAWinFX.dll)
구문
‘선언
Public Sub ReparentStrokes ( _
strokes As StrokeCollection, _
destinationNode As ContextNode _
)
‘사용 방법
Dim instance As ContextNode
Dim strokes As StrokeCollection
Dim destinationNode As ContextNode
instance.ReparentStrokes(strokes, destinationNode)
public void ReparentStrokes(
StrokeCollection strokes,
ContextNode destinationNode
)
public:
void ReparentStrokes(
StrokeCollection^ strokes,
ContextNode^ destinationNode
)
public void ReparentStrokes(
StrokeCollection strokes,
ContextNode destinationNode
)
public function ReparentStrokes(
strokes : StrokeCollection,
destinationNode : ContextNode
)
매개 변수
- strokes
형식: System.Windows.Ink.StrokeCollection
이동할 StrokeCollection입니다.
- destinationNode
형식: System.Windows.Ink.ContextNode
스트로크를 이동할 대상 ContextNode 개체입니다.
설명
지정된 ContextNode는 InkWordNode, InkDrawingNode, InkBulletNode 또는 UnclassifiedInkNode 클래스 중 하나여야 합니다. 스트로크를 다른 형식의 ContextNode로 이동하려고 하면 ArgumentException이 발생합니다.
이 메서드는 잉크가 아닌 리프 ContextNode 개체를 포함하여 모든 ContextNode 개체에서 호출할 수 있습니다. 지정한 스트로크는 이 ContextNode 개체의 하위 항목 중 하나에서 참조해야 합니다. 그렇지 않으면 ArgumentException이 발생합니다.
ContextNode 개체 또는 destinationNode가 확인되면 예외가 발생합니다.
예제
다음 예제에서는 InkDrawingNode 개체의 컬렉션으로 구성된 inkDrawingsToCombine이라는 이름의 ContextNodeCollection을 사용합니다. 이 예제에서는 ReparentStrokes 메서드를 사용하여 이를 하나의 InkDrawingNode 개체로 결합합니다.
Dim firstNode As InkDrawingNode = CType(inkDrawingsToCombine(0), InkDrawingNode)
Dim drawingNode As InkDrawingNode
For Each drawingNode In inkDrawingsToCombine
' Skip first stroke
If drawingNode = firstNode Then
GoTo ContinueForEach1
End If
' Reparent all strokes to the first node
drawingNode.ReparentStrokes(drawingNode.Strokes, firstNode)
' Delete this node
drawingNode.ParentNode.DeleteSubNode(drawingNode)
ContinueForEach1:
Next drawingNode
InkDrawingNode firstNode = (InkDrawingNode)inkDrawingsToCombine[0];
foreach (InkDrawingNode drawingNode in inkDrawingsToCombine)
{
// Skip first stroke
if (drawingNode == firstNode)
continue;
// Reparent all strokes to the first node
drawingNode.ReparentStrokes(drawingNode.Strokes, firstNode);
// Delete this node
drawingNode.ParentNode.DeleteSubNode(drawingNode);
}
플랫폼
Windows Vista
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
3.0에서 지원