Share via


XmlForm.MergeForm 메서드 (XPathNavigator)

메서드에 전달된 XPathNavigator에서 반환한 노드에 지정된 대상 양식과 현재 양식을 병합합니다.

네임스페이스:  Microsoft.Office.InfoPath
어셈블리:  Microsoft.Office.InfoPath(Microsoft.Office.InfoPath.dll)

구문

‘선언
Public MustOverride Sub MergeForm ( _
    target As XPathNavigator _
)
‘사용 방법
Dim instance As XmlForm
Dim target As XPathNavigator

instance.MergeForm(target)
public abstract void MergeForm(
    XPathNavigator target
)

매개 변수

예외

예외 조건
InvalidOperationException

MergeForm 메서드가 Loading 이벤트에 의해 호출되었습니다.

ArgumentNullException

이 메서드에 전달된 매개 변수가 Null 참조(Visual Basic의Nothing )입니다.

ArgumentException

이 메서드에 전달된 매개 변수가 유효하지 않습니다. 예를 들면 유형이나 형식이 잘못되었습니다.

주의

MergeForm 메서드는 InfoPath 편집기의 양식 병합 명령을 사용하는 것과 같습니다. target 매개 변수로 전달된 XPathNavigator에서 제공하는 XML 데이터는 현재 양식과 병합할 수 있는 유효한 XML이어야 합니다. 제공된 XML 데이터가 InfoPath 양식으로 래핑되지 않은 경우 InfoPath는 해당 데이터를 래핑합니다.

이 멤버는 현재 열려 있는 양식과 같은 도메인에서 실행하는 양식 또는 도메인 간 권한이 부여된 양식에서만 액세스할 수 있습니다.

이 형식 또는 멤버는 Microsoft InfoPath Filer에서 연 양식에서 실행되는 코드에서만 액세스할 수 있습니다.

다음 코드 예제에서는 System.Xml.XmlDocument 개체를 사용하여 지정된 URL로부터 양식을 로드한 다음 병합할 양식의 루트에 System.Xml.XPath.XPathNavigator 개체를 배치합니다. 마지막으로 XPathNavigator를 MergeForm(System.Xml.XPath.XPathNavigator) 메서드로 전달하여 양식을 현재 양식과 병합합니다.

string pathToFile = @"C:\FormToMerge\Form1.xml";
XmlDocument FormXML = new XmlDocument();

// The form tempate must be Full Trust for the 
// XmlDocument.Load method to work.
FormXML.Load(pathToFile);

XPathNavigator nav = FormXML.CreateNavigator();

// Merge the root node (the entire document) into the current form.
this.MergeForm(nav);
Dim pathToFile As String = "C:\FormToMerge\Form1.xml"
Dim FormXML As New XmlDocument

' The form tempate must be Full Trust for the 
' XmlDocument.Load method to work.
FormXML.Load(pathToFile)

Dim nav As XPathNavigator = FormXML.CreateNavigator()

' Merge the root node (the entire document) into the current form.
Me.MergeForm(nav)

참고 항목

참조

XmlForm 클래스

XmlForm 멤버

MergeForm 오버로드

Microsoft.Office.InfoPath 네임스페이스