public void mouseDidMoveOverElement(WebView sender, CFDictionaryPropertyBag elementInformation, uint modifierFlags) { object textcontent; elementInformation.RemoteRead("WebElementLinkURLKey", out textcontent, null, 0, null); if (!string.IsNullOrEmpty((string)textcontent)) { StatusTextChanged((string)textcontent); owner.StatusText = (string)textcontent; if ((string)textcontent != string.Empty) { owner.LastSelectedLink = (string)textcontent; } } else { StatusTextChanged(string.Empty); owner.StatusText = string.Empty; } textcontent = null; object el; elementInformation.RemoteRead("WebElementDOMNodeKey", out el, null, 0, null); if (el == null) { owner.setCurElSafe(null); return; } IDOMNode node = el as IDOMNode; if (node is IDOMElement || node is IDOMHTMLElement || node is IDOMHTMLTextAreaElement || node is IDOMHTMLInputElement && node != null) { owner.setCurElSafe(node); MouseDidMoveOverElement(sender, node); } else { el = null; node = null; GC.Collect(); } el = null; if (node != null) { node = null; } Marshal.ReleaseComObject(elementInformation); }
internal static Node Create(IDOMNode Node) { if (Node is IDOMDocument) { return(Document.Create(Node as IDOMDocument)); } else if (Node is IDOMAttr) { return(Attr.Create(Node as IDOMAttr)); } else if (Node is IDOMCharacterData) { return(CharacterData.Create(Node as IDOMCharacterData)); } else if (Node is IDOMElement) { return(Element.Create(Node as IDOMElement)); } else if (Node is IDOMDocumentType) { return(DocumentType.Create(Node as IDOMDocumentType)); } else if (Node is IDOMDocumentFragment) { return(DocumentFragment.Create(Node as IDOMDocumentFragment)); } else if (Node is IDOMEntityReference) { return(EntityReference.Create(Node as IDOMEntityReference)); } else if (Node is IDOMProcessingInstruction) { return(ProcessingInstruction.Create(Node as IDOMProcessingInstruction)); } else { return(new Node(Node)); } }
void uiDelegate_UpdateCurrentElement(WebView sender, IDOMNode element) { if (element is IDOMHTMLInputElement) undoManager.node = (IDOMHTMLInputElement)element; try { if (element != null && element.GetType().Name != "__ComObject") MouseDidMoveOverElement(this, new MouseDidMoveOverElementEventArgs((Element)Element.Create(element))); } catch { } }
internal void setCurElSafe(IDOMNode n) { if (_el != null) { Marshal.ReleaseComObject(_el); _el = null; } _el = n; GC.Collect(); }
public void shouldInsertNode(WebView WebView, IDOMNode node, IDOMRange range, _WebViewInsertAction action) { throw new NotImplementedException(); }
/// <summary> /// Node Constructor. /// </summary> /// <param name="Node">WebKit IDOMNode object.</param> protected Node(IDOMNode Node) { this.node = Node; }