protected override EnumResult OnProcessing(NodeContent content, NodeModifier[] nextNode) { switch (Mode) { case KillMode.Node: for (int i = 0; i < nextNode.Length; i++) { if (nextNode[i].Parent != this) { nextNode[i].ForceStop(); content.RemoveContenNode(nextNode[i]); } } break; case KillMode.NodeAndChild: for (int i = 0; i < nextNode.Length; i++) { if (nextNode[i].Parent != this) { RemoveChild(content, nextNode[i]); } } break; } return(EnumResult.Success); }
/// <summary> /// 从父容器中删除自己 /// </summary> public void RemoveFromContent() { if (_content != null) { _content.RemoveContenNode(this); _content = null; } }
protected void RemoveChild(NodeContent content, NodeModifier node) { if (content.RemoveContenNode(node)) { node.ForceStop(); } NodeModifier[] nodes = node.NextNodes; for (int i = 0; i < nodes.Length; i++) { if (nodes[i].Parent != node) { continue; } RemoveChild(content, nodes[i]); } }