public void append(Node nodes) { if (nodes.childNodes.Contains(this)) throw new DOMException(ExceptionCodes.HIERARCHY_REQUEST_ERR); insertBefore(nodes, null); }
protected int Filter(Node node) { if (_activeFlag) { throw new DOMError("The object is in an invalid state."); } int nodeType = node.nodeType; if (!((whatToShow)whatToShow).HasFlag((whatToShow)((1 << nodeType) / 2))) { return FilterResult.FILTER_SKIP; } if (filter == null) { return FilterResult.FILTER_ACCEPT; } _activeFlag = true; int result; try { result = filter.acceptNode(node); } catch (Exception e) { throw e; } finally { _activeFlag = false; } return result; }
public NodeChangedEventArgs(Node node, Node oldParent, Node newParent, string oldValue, string newValue, NodeChangedAction action) { this.Node = node; this.OldParent = oldParent; this.NewParent = newParent; this.Action = action; this.OldValue = oldValue; this.NewValue = newValue; }
public Node(Document doc) { ownerDocument = doc; _parentNode = doc; //if (_parentNode == null) //{ //} }
public void initMutationEvent(string typeArg, bool canBubbleArg, bool cancelableArg, Node relatedNodeArg, string prevValueArg, string newValueArg, string attrNameArg, short attrChangeArg) { base.initEvent(typeArg, canBubbleArg, cancelableArg); relatedNode = relatedNodeArg; prevValue = prevValueArg; newValue = newValueArg; attrName = attrNameArg; attrChange = attrChangeArg; }
//NEW (SUPPORTED!) public void prepend(Node nodes) { if (children.length <= 0) return; if (children[0] == null) return; children[0].prepend(nodes); }
public void after(Node nodes) { if (this.parentNode == null) return; if (nodes.childNodes.Contains(this)) throw new DOMException(ExceptionCodes.HIERARCHY_REQUEST_ERR); //Run the mutation method macro. parentNode.insertBefore(nodes, this.nextSibling); }
internal bool Contains(Node node) { foreach (var item in this) { if (node == item) { return true; } } return false; }
public void prepend(Node nodes) { if (nodes.childNodes.Contains(this)) throw new DOMException(ExceptionCodes.HIERARCHY_REQUEST_ERR); //Run the mutation method macro. //Pre-insert node into the context object before the context object's first child. if (this.childNodes.length == 0) { append(nodes); } else { insertBefore(nodes, this.childNodes[0]); } }
public void setEndAfter(Node refNode) { throw new NotImplementedException(); }
public void setStart(Node refNode, long offset) { throw new NotImplementedException(); }
public bool isPointInRange(Node node, long offset) { throw new NotImplementedException(); }
public void selectNodeContents(Node refNode) { throw new NotImplementedException(); }
public bool MoveNext() { if (isFirst) { isFirst = false; } else if (current != null) { current = current.nextSibling; } return current != null; }
public bool intersectsNode(Node node) { throw new NotImplementedException(); }
public short comparePoint(Node node, long offset) { throw new NotImplementedException(); }
public void observe(Node target, MutationObserverInit options);
public TreeWalker createTreeWalker(Node root, long whatToShow = NodeFilter.SHOW_ALL, NodeFilter filter = null) { return new TreeWalker(root, whatToShow, filter); }
public void setStartBefore(Node refNode) { throw new NotImplementedException(); }
public NodeIterator createNodeIterator(Node root, long whatToShow = NodeFilter.SHOW_ALL, NodeFilter filter = null) { return new NodeIterator(root, whatToShow, filter); }
public Node adoptNode(Node node) { throw new NotImplementedException(); }
private Node Traverse(bool directionNext) { Node next = null; bool beforeNode = pointerBeforeReferenceNode; while (true) { if (directionNext) { if (beforeNode) { beforeNode = false; } else { next = referenceNode.nextSibling; if (next == null) { return null; } } } else { if (beforeNode) { next = referenceNode.previousSibling; if (next == null) { return null; } } else { beforeNode = true; } } int result; try { result = base.Filter(next); } catch (Exception) { return null; } if (result == FilterResult.FILTER_ACCEPT) { break; } } pointerBeforeReferenceNode = beforeNode; referenceNode = next; return next; }
public NodeIterator(Node root, long whatToShow, NodeFilter filter) : base(root, whatToShow, filter) { this.referenceNode = root; this.pointerBeforeReferenceNode = true; }
public void Reset() { current = parent.firstChild; isFirst = true; }
public void surroundContents(Node newParent) { throw new NotImplementedException(); }
public void prepend(Node nodes) { throw new NotImplementedException(); }
public void insertNode(Node node) { throw new NotImplementedException(); }
internal NodeChangedEventArgs GetEventArgs(Node node, Node oldParent, Node newParent, string oldValue, string newValue, NodeChangedAction action) { reportValidity = false; switch (action) { case NodeChangedAction.Insert: if (onNodeInsertingDelegate == null && onNodeInsertedDelegate == null) { return null; } break; case NodeChangedAction.Remove: if (onNodeRemovingDelegate == null && onNodeRemovedDelegate == null) { return null; } break; case NodeChangedAction.Change: if (onNodeChangingDelegate == null && onNodeChangedDelegate == null) { return null; } break; } return new NodeChangedEventArgs(node, oldParent, newParent, oldValue, newValue, action); }
public Node importNode(Node node, bool deep = true) { if (node.nodeType == (int)NodeType.DOCUMENT_NODE) { throw new DOMError("The operation is not supported."); } Node n = node.cloneNode(deep); n.ownerDocument = this; return n; }
public NodeList(Node parent) { this.parent = parent; }