Пример #1
0
        protected void AddChild(Tool child)
        {
            if (child == null || m_children.Contains(child))
            {
                return;
            }

            m_children.Add(child);
            child.m_parent = this;
            child.OnAdd();
        }
Пример #2
0
    protected void AddChild( Tool child )
    {
      if ( child == null || m_children.Contains( child ) )
        return;

      m_children.Add( child );
      child.m_parent = this;
      child.OnAdd();

      ToolManager.OnChildAdded( child );
    }
Пример #3
0
        /// <summary>
        /// Remove old tool (if present) and activate new. If <paramref name="tool"/> is null
        /// the current active tool is removed.
        /// </summary>
        /// <param name="tool">New top level tool to activate - null is equal to RemoveActiveTool.</param>
        /// <returns>The new tool.</returns>
        public static Tool ActivateTool(Tool tool)
        {
            RemoveActiveTool();

            m_active = tool;
            if (m_active != null)
            {
                m_active.OnAdd();
            }

            return(m_active);
        }