XmlDocument.NodeChanging 事件


發生於屬於這份文件之節點的 Value 即將變更時。Occurs when the Value of a node belonging to this document is about to be changed.

 event System::Xml::XmlNodeChangedEventHandler ^ NodeChanging;
public event System.Xml.XmlNodeChangedEventHandler NodeChanging;
member this.NodeChanging : System.Xml.XmlNodeChangedEventHandler 
Public Custom Event NodeChanging As XmlNodeChangedEventHandler 


此事件可讓使用者執行額外的檢查, 並視需要擲回例外狀況以停止作業。This event allows the user to do extra checking and, if necessary, throw an exception to stop the operation. 如果擲回例外狀況, XmlDocument則會回到其原始狀態。If an exception is thrown the XmlDocument returns to its original state. 此事件僅適用于具有值的節點。This event only applies to nodes that have a value.

本檔所建立的所有節點 (不論是否已插入檔) 都會包含在此事件中。All nodes created by this document, whether or not they have been inserted into the document, are included in this event.