protected void AddChild(Tool child) { if (child == null || m_children.Contains(child)) { return; } m_children.Add(child); child.m_parent = this; child.OnAdd(); }
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 ); }
/// <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); }