Share via


DocActionEvent.Source property

Gets a reference to the inner-most XML Document Object Model (DOM) node of a form's underlying XML document.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Syntax

'Declaration
ReadOnly Property Source As IXMLDOMNode
    Get
'Usage
Dim instance As DocActionEvent
Dim value As IXMLDOMNode

value = instance.Source
IXMLDOMNode Source { get; }

Property value

Type: Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode

Remarks

After you have set a reference to the XML DOM node that the Source property returns, you can use any of the properties and methods that are supported by the XML DOM.

Important

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

Examples

In the following example, the Source property of the DocActionEventObject object is used to display the source XML data of the inner-most XML Document Object Model (DOM) node of the form's underlying XML document, which contains the button:

[InfoPathEventHandler(MatchPath="ShowDocActionEventSource", EventType=InfoPathEventType.OnClick)]
public void ShowDocActionEventSource_OnClick(DocActionEvent e)
{
 thisXDocument.UI.Alert("Source: " + e.Source.xml);
}

In the following example, the Source property of the DocActionEventObject object is used to display the source XML data of the XML DOM node in a message box:

[InfoPathEventHandler(MatchPath="DocActionEventSource", EventType=InfoPathEventType.OnClick)]
public void DocActionEventSource_OnClick(DocActionEvent e)
{
 thisXDocument.UI.Alert("Source: " + e.Source.xml);
}

See also

Reference

DocActionEvent interface

DocActionEvent members

Microsoft.Office.Interop.InfoPath.SemiTrust namespace