public XmlNodeChangedEventArgs( XmlNode node, XmlNode oldParent, XmlNode newParent, string oldValue, string newValue, XmlNodeChangedAction action ) {
     this.node = node;
     this.oldParent = oldParent;
     this.newParent = newParent;
     this.action = action;
     this.oldValue = oldValue;
     this.newValue = newValue;
 }
	// Constructor.
	internal XmlNodeChangedEventArgs
				(XmlNodeChangedAction action, XmlNode node,
				 XmlNode oldParent, XmlNode newParent)
			{
				this.action = action;
				this.node = node;
				this.oldParent = oldParent;
				this.newParent = newParent;
			}
Esempio n. 3
0
 public XmlNodeChangedEventArgs(XmlNode node, XmlNode oldParent, XmlNode newParent, string oldValue, string newValue, XmlNodeChangedAction action)
 {
     _node = node;
     _oldParent = oldParent;
     _newParent = newParent;
     _action = action;
     _oldValue = oldValue;
     _newValue = newValue;
 }
Esempio n. 4
0
 // Methods
 public UnDoOperation(SvgDocument doc, XmlNode changeelement, XmlNode oldparent, XmlNode newparent, XmlNodeChangedAction action, SvgElement changeparent)
 {
     this.oldvalue = string.Empty;
     this.newvalue = string.Empty;
     this.changeParent = changeparent;
     this.document = doc;
     this.changeAction = action;
     this.oldParent = oldparent;
     this.newParent = newparent;
     this.changeElement = changeelement;
     this.nextSibling = this.changeElement.NextSibling;
     this.preSibling = this.changeElement.PreviousSibling;
     if (this.changeElement is SvgElement)
     {
         while (this.nextSibling != null)
         {
             if (this.nextSibling is SvgElement)
             {
                 break;
             }
             this.nextSibling = this.nextSibling.NextSibling;
         }
         while (this.preSibling != null)
         {
             if (this.preSibling is SvgElement)
             {
                 break;
             }
             this.preSibling = this.preSibling.PreviousSibling;
         }
     }
     if (this.changeElement != null)
     {
         this.newvalue = this.changeElement.Value;
     }
     if (this.changeParent != null)
     {
         this.oldvalue = this.changeParent.BeforeChangeValueStr;
     }
 }
Esempio n. 5
0
            public XmlNodeTrackBack(XmlNodeChangedEventArgs ea)
            {
                Node   = ea.Node;
                Action = ea.Action;
                switch (ea.Action)
                {
                case XmlNodeChangedAction.Insert:
                    Value = ea.NewParent;
                    break;

                case XmlNodeChangedAction.Remove:
                    Value = ea.OldParent;
                    break;

                case XmlNodeChangedAction.Change:
                    Value = ea.OldValue;
                    break;

                default:
                    throw new ArgumentOutOfRangeException("ea", ea.Action, string.Format("Unknown XmlNodeChangedAction"));
                }
            }
Esempio n. 6
0
 private void elementChangeEvent(Object src, XmlNodeChangedEventArgs args)
 {
     lastSrc    = src;
     lastNode   = args.Node;
     lastAction = args.Action;
 }
Esempio n. 7
0
        internal virtual XmlNodeChangedEventArgs GetEventArgs(XmlNode node, XmlNode oldParent, XmlNode newParent, XmlNodeChangedAction action)
        {
            XmlDocument doc = OwnerDocument;

            if (doc != null)
            {
                if (!doc.IsLoading)
                {
                    if (((newParent != null && newParent.IsReadOnly) || (oldParent != null && oldParent.IsReadOnly)))
                    {
                        throw new InvalidOperationException(Res.GetString(Res.Xdom_Node_Modify_ReadOnly));
                    }
                    doc.fIsEdited = true;
                }
                return(doc.GetEventArgs(node, oldParent, newParent, action));
            }
            return(null);
        }
 public XmlNodeChangedEventArgs(XmlNode node, XmlNode oldParent, XmlNode newParent, string oldValue, string newValue, XmlNodeChangedAction action)
 {
     _node      = node;
     _oldParent = oldParent;
     _newParent = newParent;
     _action    = action;
     _oldValue  = oldValue;
     _newValue  = newValue;
 }
Esempio n. 9
0
        internal override XmlNodeChangedEventArgs GetEventArgs(XmlNode node, XmlNode oldParent, XmlNode newParent, string oldValue, string newValue, XmlNodeChangedAction action)
        {
            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));
        }
Esempio n. 10
0
        internal override XmlNodeChangedEventArgs GetEventArgs( XmlNode node, XmlNode oldParent, XmlNode newParent, XmlNodeChangedAction action ) {
            if ((action == XmlNodeChangedAction.Insert && (onNodeInsertingDelegate != null || onNodeInsertedDelegate != null))
                || (action == XmlNodeChangedAction.Remove && (onNodeRemovingDelegate != null || onNodeRemovedDelegate != null))
                || (action == XmlNodeChangedAction.Change && (onNodeChangingDelegate != null || onNodeChangedDelegate != null))) {
                return new XmlNodeChangedEventArgs( node, oldParent, newParent, action );
            }

            return null;
        }
Esempio n. 11
0
		XmlNodeChangedEventArgs (
			XmlNode node, 
			XmlNode oldParent,
			XmlNode newParent,
			string oldValue,
			string newValue,
			XmlNodeChangedAction action)
		{
			_node = node;
			_oldParent = oldParent;
			_newParent = newParent;
#if NET_2_0			
			_oldValue = oldValue;
			_newValue = newValue;
#endif			
			_action = action;
		}
Esempio n. 12
0
 private void elementChangeEvent(Object src, XmlNodeChangedEventArgs args)
 {
     lastSrc = src;
             lastNode = args.Node;
             lastAction = args.Action;
 }
Esempio n. 13
0
 private void clearAllLast()
 {
     lastSrc = null;
             lastNode = null;
             lastAction = 0;
 }
 // Constructors
 public XmlNodeChangedEventArgs(XmlNode node, XmlNode oldParent, XmlNode newParent, string oldValue, string newValue, XmlNodeChangedAction action)
 {
 }
Esempio n. 15
0
	// Emit an event before a particular node change.  Returns an
	// argument block if "EmitAfter" may be needed, or null if not.
	internal XmlNodeChangedEventArgs EmitBefore
					(XmlNodeChangedAction action, XmlNode node,
				 	 XmlNode oldParent, XmlNode newParent)
			{
				XmlNodeChangedEventArgs args = null;
				switch(action)
				{
					case XmlNodeChangedAction.Insert:
					{
						if(NodeInserting != null)
						{
							args = new XmlNodeChangedEventArgs
								(action, node, oldParent, newParent);
							NodeInserting(this, args);
						}
						else if(NodeInserted != null)
						{
							args = new XmlNodeChangedEventArgs
								(action, node, oldParent, newParent);
						}
					}
					break;

					case XmlNodeChangedAction.Remove:
					{
						if(NodeRemoving != null)
						{
							args = new XmlNodeChangedEventArgs
								(action, node, oldParent, newParent);
							NodeRemoving(this, args);
						}
						else if(NodeRemoved != null)
						{
							args = new XmlNodeChangedEventArgs
								(action, node, oldParent, newParent);
						}
					}
					break;

					case XmlNodeChangedAction.Change:
					{
						if(NodeChanging != null)
						{
							args = new XmlNodeChangedEventArgs
								(action, node, oldParent, newParent);
							NodeChanging(this, args);
						}
						else if(NodeChanged != null)
						{
							args = new XmlNodeChangedEventArgs
								(action, node, oldParent, newParent);
						}
					}
					break;
				}
				return args;
			}
Esempio n. 16
0
			public XmlNodeTrackBack(XmlNodeChangedEventArgs ea)
			{
				Node   = ea.Node;
				Action = ea.Action;
				switch(ea.Action)
				{
					case XmlNodeChangedAction.Insert:
						Value = ea.NewParent;
						break;
					case XmlNodeChangedAction.Remove:
						Value = ea.OldParent;
						break;
					case XmlNodeChangedAction.Change:
						Value = ea.OldValue;
						break;
					default:
						throw new ArgumentOutOfRangeException("ea", ea.Action, string.Format("Unknown XmlNodeChangedAction"));
				}
			}
Esempio n. 17
0
 internal override XmlNodeChangedEventArgs GetEventArgs(XmlNode node, XmlNode oldParent, XmlNode newParent, string oldValue, string newValue, XmlNodeChangedAction action)
 {
     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);
 }
Esempio n. 18
0
 // Methods
 public UnDoOperation(SvgDocument doc, XmlNode changeelement, XmlNode oldparent, XmlNode newparent, XmlNodeChangedAction action, SvgElement changeparent)
 {
     this.oldvalue      = string.Empty;
     this.newvalue      = string.Empty;
     this.changeParent  = changeparent;
     this.document      = doc;
     this.changeAction  = action;
     this.oldParent     = oldparent;
     this.newParent     = newparent;
     this.changeElement = changeelement;
     this.nextSibling   = this.changeElement.NextSibling;
     this.preSibling    = this.changeElement.PreviousSibling;
     if (this.changeElement is SvgElement)
     {
         while (this.nextSibling != null)
         {
             if (this.nextSibling is SvgElement)
             {
                 break;
             }
             this.nextSibling = this.nextSibling.NextSibling;
         }
         while (this.preSibling != null)
         {
             if (this.preSibling is SvgElement)
             {
                 break;
             }
             this.preSibling = this.preSibling.PreviousSibling;
         }
     }
     if (this.changeElement != null)
     {
         this.newvalue = this.changeElement.Value;
     }
     if (this.changeParent != null)
     {
         this.oldvalue = this.changeParent.BeforeChangeValueStr;
     }
 }
Esempio n. 19
0
 internal XmlNodeChangedEventArgs(XmlNode node, XmlNode oldParent, XmlNode newParent, XmlNodeChangedAction action)
 {
     this.node      = node;
     this.oldParent = oldParent;
     this.newParent = newParent;
     this.action    = action;
 }
        internal override XmlNodeChangedEventArgs GetEventArgs(XmlNode node, XmlNode oldParent, XmlNode newParent, string oldValue, string newValue, XmlNodeChangedAction action)
        {
            this.reportValidity = false;
            switch (action)
            {
                case XmlNodeChangedAction.Insert:
                    if ((this.onNodeInsertingDelegate != null) || (this.onNodeInsertedDelegate != null))
                    {
                        break;
                    }
                    return null;

                case XmlNodeChangedAction.Remove:
                    if ((this.onNodeRemovingDelegate != null) || (this.onNodeRemovedDelegate != null))
                    {
                        break;
                    }
                    return null;

                case XmlNodeChangedAction.Change:
                    if ((this.onNodeChangingDelegate != null) || (this.onNodeChangedDelegate != null))
                    {
                        break;
                    }
                    return null;
            }
            return new XmlNodeChangedEventArgs(node, oldParent, newParent, oldValue, newValue, action);
        }
Esempio n. 21
0
 public XmlNodeChangedEventArgs(XmlNode node, XmlNode oldParent, XmlNode newParent, string oldValue, string newValue, XmlNodeChangedAction action);
Esempio n. 22
0
	// Emit an event just before a change.  Returns an argument
	// block if an after event will also need to be emitted.
	internal XmlNodeChangedEventArgs EmitBefore
				(XmlNodeChangedAction action,
			     XmlNode oldParent, XmlNode newParent)
			{
				XmlDocument doc = FindOwnerQuick();
				if(doc != null)
				{
					return doc.EmitBefore(action, this, oldParent, newParent);
				}
				else
				{
					return null;
				}
			}
        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));
        }
Esempio n. 24
0
	internal XmlNodeChangedEventArgs EmitBefore(XmlNodeChangedAction action)
			{
				XmlDocument doc = FindOwnerQuick();
				if(doc != null)
				{
					XmlNode parent = ParentNode;
					return doc.EmitBefore(action, this, parent, parent);
				}
				else
				{
					return null;
				}
			}
Esempio n. 25
0
 internal virtual XmlNodeChangedEventArgs GetEventArgs(XmlNode node, XmlNode oldParent, XmlNode newParent, string oldValue, string newValue, XmlNodeChangedAction action)
 {
     XmlDocument doc = OwnerDocument;
     if (doc != null)
     {
         if (!doc.IsLoading)
         {
             if (((newParent != null && newParent.IsReadOnly) || (oldParent != null && oldParent.IsReadOnly)))
                 throw new InvalidOperationException(SR.Xdom_Node_Modify_ReadOnly);
         }
         return doc.GetEventArgs(node, oldParent, newParent, oldValue, newValue, action);
     }
     return null;
 }
Esempio n. 26
0
 public XmlNodeChangedEventArgs(XmlNode node, XmlNode oldParent, XmlNode newParent, string oldValue, string newValue, XmlNodeChangedAction action)
 {
     this.node      = node;
     this.oldParent = oldParent;
     this.newParent = newParent;
     this.action    = action;
     this.oldValue  = oldValue;
     this.newValue  = newValue;
 }
 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);
 }
Esempio n. 28
0
 private void clearAllLast()
 {
     lastSrc    = null;
     lastNode   = null;
     lastAction = 0;
 }