public override void HandleAttributeChange(XmlAttribute attribute) { if (attribute.NamespaceURI.Length == 0) { switch (attribute.LocalName) { case "x": _x = null; return; case "y": _y = null; return; case "width": _width = null; return; case "height": _height = null; return; } } else if (attribute.NamespaceURI == SvgDocument.XLinkNamespace) { switch (attribute.LocalName) { case "href": _instanceRoot = null; break; } } base.HandleAttributeChange(attribute); }
public SvgElementInstance(XmlNode refNode, SvgUseElement useElement, SvgElementInstance parent) { correspondingUseElement = (ISvgUseElement)useElement; parentNode = (SvgElementInstance)parent; correspondingElement = (ISvgElement)refNode; eventTarget = new EventTarget(this); }
public SvgElementInstance(XmlNode refNode, SvgUseElement useElement, SvgElementInstance parent) { _correspondingUseElement = useElement; _parentNode = parent; _correspondingElement = refNode as ISvgElement; _eventTarget = new EventTarget(this); }
public SvgElementInstance(XmlNode refNode, SvgUseElement useElement, SvgElementInstance parent) { correspondingUseElement = (ISvgUseElement)useElement; parentNode = (SvgElementInstance)parent; correspondingElement = (ISvgElement)refNode; eventTarget = new EventTarget(this); }
internal void SetPreviousSibling(ISvgElementInstance instance) { previousSibling = instance; }
internal void SetNextSibling(ISvgElementInstance instance) { nextSibling = instance; }
public JsSvgElementInstance(ISvgElementInstance baseObject, ISvgScriptEngine engine) : base(baseObject, engine) { }
internal void SetNextSibling(ISvgElementInstance instance) { _nextSibling = instance; }
internal void SetPreviousSibling(ISvgElementInstance instance) { _previousSibling = instance; }
public override void HandleAttributeChange(XmlAttribute attribute) { if (attribute.NamespaceURI.Length == 0) { switch (attribute.LocalName) { case "x": x = null; return; case "y": y = null; return; case "width": width = null; return; case "height": height = null; return; } } else if (attribute.NamespaceURI == SvgDocument.XLinkNamespace) { switch (attribute.LocalName) { case "href": instanceRoot = null; break; } } base.HandleAttributeChange(attribute); }
public bool DispatchEvent( IEvent @event) { if (@event.Type == null || @event.Type == "") { throw new EventException(EventExceptionCode.UnspecifiedEventTypeErr); } try { // The actual target may be an SvgElement or an SvgElementInstance from // a conceptual tree <see href="http://www.w3.org/TR/SVG/struct.html#UseElement"/> XmlNode currNode = null; ISvgElementInstance currInstance = null; if (this.eventTarget is ISvgElementInstance) { currInstance = (ISvgElementInstance)this.eventTarget; } else { currNode = (XmlNode)this.eventTarget; } // We can't use an XPath ancestor axe because we must account for // conceptual nodes ancestors.Clear(); // Buid the ancestors from the conceptual tree if (currInstance != null) { while (currInstance.ParentNode != null) { currInstance = currInstance.ParentNode; ancestors.Add(currInstance); } currNode = (XmlNode)currInstance.CorrespondingUseElement; ancestors.Add(currNode); } // Build actual ancestors while (currNode != null && currNode.ParentNode != null) { currNode = currNode.ParentNode; ancestors.Add(currNode); } Event realEvent = (Event)@event; realEvent.eventTarget = this.eventTarget; if (!realEvent.stopped) { realEvent.eventPhase = EventPhase.CapturingPhase; for (int i = ancestors.Count - 1; i >= 0; i--) { if (realEvent.stopped) { break; } IEventTarget ancestor = ancestors[i] as IEventTarget; if (ancestor != null) { realEvent.currentTarget = ancestor; if (ancestor is IEventTargetSupport) { ((IEventTargetSupport)ancestor).FireEvent(realEvent); } } } } if (!realEvent.stopped) { realEvent.eventPhase = EventPhase.AtTarget; realEvent.currentTarget = this.eventTarget; this.eventTarget.FireEvent(realEvent); } if (!realEvent.stopped) { realEvent.eventPhase = EventPhase.BubblingPhase; for (int i = 0; i < ancestors.Count; i++) { if (realEvent.stopped) { break; } IEventTarget ancestor = ancestors[i] as IEventTarget; if (ancestor != null) { realEvent.currentTarget = ancestor; ((IEventTargetSupport)ancestor).FireEvent(realEvent); } } } return(realEvent.stopped); } catch (InvalidCastException) { throw new DomException(DomExceptionType.WrongDocumentErr); } }