System.Xml.XmlDocument.GetEventArgs C# (CSharp) Method

GetEventArgs() private method

private GetEventArgs ( XmlNode node, XmlNode oldParent, XmlNode newParent, string oldValue, string newValue, XmlNodeChangedAction action ) : XmlNodeChangedEventArgs
node XmlNode
oldParent XmlNode
newParent XmlNode
oldValue string
newValue string
action XmlNodeChangedAction
return XmlNodeChangedEventArgs
        internal override XmlNodeChangedEventArgs GetEventArgs(XmlNode node, XmlNode oldParent, XmlNode newParent, string oldValue, string newValue, XmlNodeChangedAction action)
        {
            _reportValidity = false;

            switch (action)
            {
                case XmlNodeChangedAction.Insert:
                    if (_onNodeInsertingDelegate == null && _onNodeInsertedDelegate == null)
                    {
                        return null;
                    }
                    break;
                case XmlNodeChangedAction.Remove:
                    if (_onNodeRemovingDelegate == null && _onNodeRemovedDelegate == null)
                    {
                        return null;
                    }
                    break;
                case XmlNodeChangedAction.Change:
                    if (_onNodeChangingDelegate == null && _onNodeChangedDelegate == null)
                    {
                        return null;
                    }
                    break;
            }
            return new XmlNodeChangedEventArgs(node, oldParent, newParent, oldValue, newValue, action);
        }

Usage Example

        internal virtual XmlNodeChangedEventArgs GetEventArgs(XmlNode node, XmlNode oldParent, XmlNode newParent, string oldValue, string newValue, XmlNodeChangedAction action)
        {
            XmlDocument ownerDocument = this.OwnerDocument;

            if (ownerDocument == null)
            {
                return(null);
            }
            if (!ownerDocument.IsLoading && (((newParent != null) && newParent.IsReadOnly) || ((oldParent != null) && oldParent.IsReadOnly)))
            {
                throw new InvalidOperationException(Res.GetString("Xdom_Node_Modify_ReadOnly"));
            }
            return(ownerDocument.GetEventArgs(node, oldParent, newParent, oldValue, newValue, action));
        }
All Usage Examples Of System.Xml.XmlDocument::GetEventArgs