public static int GetIndex(this Command command, IScriptManager ScriptManager)
        {
            var script = ScriptManager.GetScriptFromCommand(command);
            var node   = script.Commands.GetNodeFromValue(command);

            return(node.parent.IndexOf(command));
        }
        public void deleteToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            var selectedNode = treeListView.SelectedObject as HierarchyNode;

            if (selectedNode == null)
            {
                return;
            }

            if (selectedNode.Script != null)
            {
                ScriptManager.RemoveScript(selectedNode.Script);
            }
            else if (selectedNode.Command != null)
            {
                ScriptManager.GetScriptFromCommand(selectedNode.Command).RemoveCommand(selectedNode.Command);
            }

            RefreshTreeListViewAsync();

            ASSERT_TreeViewIsTheSameAsInScriptManager();
        }