示例#1
0
        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);
        }
示例#2
0
 /// <summary>
 /// 从父容器中删除自己
 /// </summary>
 public void RemoveFromContent()
 {
     if (_content != null)
     {
         _content.RemoveContenNode(this);
         _content = null;
     }
 }
示例#3
0
        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]);
            }
        }