DocContextChangeEvent.Context 屬性
取得 DocContextChangeEventObject 物件所提供新內容節點的「XML 文件物件模型」(DOM) 節點參考。
**命名空間:**Microsoft.Office.Interop.InfoPath
**組件:**Microsoft.Office.Interop.InfoPath (於 microsoft.office.interop.infopath.dll 中)
語法
'宣告
<DispIdAttribute(1)> _
ReadOnly Property Context As IXMLDOMNode
'用途
Dim instance As DocContextChangeEvent
Dim value As IXMLDOMNode
value = instance.Context
[DispIdAttribute(1)]
IXMLDOMNode Context { get; }
範例
在下列範例中,會更新名為 lastChanged 的節點以回應內容變更:
public void OnContextChange(DocContextChangeEvent e)
{
if ( e.Type == "ContextNode" && !e.IsUndoRedo )
{
IXMLDOMNode contextNode = e.Context;
IXMLDOMNode lastChangedNode = thisXDocument.DOM.selectSingleNode("my:lastChanged");
lastChangedNode.text = contextNode.nodeName;
}
}
請參閱
參考
DocContextChangeEvent 介面
DocContextChangeEvent 成員
Microsoft.Office.Interop.InfoPath 命名空間