}// MenuCommand

        internal override void TaskPadTaskNotify(Object arg, Object param, IConsole2 con, CData com)
        {
            // We want to browse this apps properties
            if ((int)arg == 0)
            {
                OpenMyPropertyPage();
            }

            // We want to browse the Assembly Dependencies
            else if ((int)arg == 1)
            {
                CNode node = FindChild("Assembly Dependencies");
                CNodeManager.SelectScopeItem(node.HScopeItem);
                node.MenuCommand(COMMANDS.SHOW_LISTVIEW);
            }
            // We want to Configure Assemblies
            else if ((int)arg == 2)
            {
                CNode node = FindChild("Configured Assemblies");
                CNodeManager.SelectScopeItem(node.HScopeItem);
            }
            // We want to go to remoting node
            else if ((int)arg == 3)
            {
                CNode node = FindChild("Remoting Services");
                CNodeManager.SelectScopeItem(node.HScopeItem);
                node.OpenMyPropertyPage();
            }
            else if ((int)arg == 4)
            {
                MenuCommand(COMMANDS.FIX_APPLICATION);
                // Inform our Command History that we did this
                CCommandHistory.CommandExecuted(new CDO(this), COMMANDS.FIX_APPLICATION);
            }
        }// TaskPadTaskNotify
        }// CIntroTaskPad

        internal override void Notify(Object arg, Object param, IConsole2 con, CData com)
        {
            String sNodeToOpen = null;


            // We want to browse the shared assemblies
            if ((int)arg == 1)
            {
                sNodeToOpen = "Assembly Cache";
            }
            // We want to Configure Assemblies
            else if ((int)arg == 2)
            {
                sNodeToOpen = "Configured Assemblies";
            }
            // We want to set Security Policy
            else if ((int)arg == 3)
            {
                sNodeToOpen = "Runtime Security Policy";
            }
            // We want to go to remoting node
            else if ((int)arg == 4)
            {
                CNode node = m_myNode.FindChild("Remoting Services");
                CNodeManager.SelectScopeItem(node.HScopeItem);
                node.OpenMyPropertyPage();
            }
            // We want to go to the applications node
            else if ((int)arg == 5)
            {
                sNodeToOpen = "Applications";
            }



            // This is a CommandHistory item
            else if ((int)arg >= 100)
            {
                CCommandHistory.FireOffCommand((int)arg);
            }
            else
            {
                MessageBox(0, "Error in web page! I don't know what to do!", "", 0);
            }

            if (sNodeToOpen != null)
            {
                CNode node = m_myNode.FindChild(sNodeToOpen);
                // This node must have a shared assemblies node... if it doesn't, then the
                // node hasn't added it's children yet. We'll force it to do that, and try
                // again
                if (node == null)
                {
                    m_myNode.CreateChildren();
                    node = m_myNode.FindChild(sNodeToOpen);
                }
                CNodeManager.Console.SelectScopeItem(node.HScopeItem);
            }
        }// Notify
Beispiel #3
0
        }// FireOffCommand(int)

        static private bool ExecuteCommand(CommandHistory chCommand, bool fActuallyExecute)
        {
            // Ok, let's run through the nodes until we find the node we want
            CNode node       = CNodeManager.GetNode(CNodeManager.RootNodeCookie);
            int   iTreeLevel = chCommand.scPathToNode.Count - 1;

            while (node != null && iTreeLevel >= 0)
            {
                // Expand this node
                node = GetChild(node, chCommand.scPathToNode[iTreeLevel]);
                iTreeLevel--;
            }

            // Ok, now let's see if we were just trying to figure out if this command existed...
            if (!fActuallyExecute)
            {
                // Yes, this command will work
                if (node != null)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }


            if (node != null)
            {
                int iResultNum = GetResultNum(node, chCommand.scResultItem);

                // We have the node. Let's do something to it
                // If it was a property page, let's fire that off
                if (chCommand.iMenuCommand == -1)
                {
                    // See if we're just opening up the node's property page
                    if (iResultNum == -1)
                    {
                        node.OpenMyPropertyPage();
                    }
                    else
                    {
                        CDO cdo = new CDO(node);
                        // Make sure the result num is 1-based
                        cdo.Data = iResultNum + 1;
                        node.OpenMyResultPropertyPage(node.DisplayName, cdo);
                    }
                }
                // It was some sort of menu command. Let's fire that off
                else
                {
                    if (iResultNum == -1)
                    {
                        node.MenuCommand(chCommand.iMenuCommand);
                    }
                    else // This is a result item's command
                         // Make sure we make the result number 1-based
                    {
                        node.MenuCommand(chCommand.iMenuCommand, iResultNum + 1);
                    }
                }


                // Last but not least, let's go visit that node.
                CNodeManager.Console.SelectScopeItem(node.HScopeItem);


                return(true);
            }
            return(false);
        }// ExecuteCommand(int, bool)