Пример #1
0
        }// Command

        //-------------------------------------------------------
        // Stuff for IExtendPropertySheet2 - This will only be
        // called for stuff in the scope view
        //-------------------------------------------------------

        //-------------------------------------------------
        // CreatePropertyPages
        //
        // MMC calls this function when it wants a property
        // page for a specified node.
        //-------------------------------------------------
        public int CreatePropertyPages(IPropertySheetCallback lpProvider, IntPtr handle, IDataObject lpIDataObject)
        {
            // This is really a CDO in disguise
            CDO victim = (CDO)lpIDataObject;

            // See if I really need to do this....
            if (m_ucsole != null)
            {
                IPropertySheetProvider psp = (IPropertySheetProvider)m_ucsole;

                if (psp.FindPropertySheet(victim.Node.Cookie, null, victim) == HRESULT.S_OK)
                {
                    return(HRESULT.S_FALSE);
                }
            }
            // Let's see if this node has property pages
            if (victim.Node != null && victim.Node.HavePropertyPagesCreate)
            {
                // If we've fired up a wizard, then that command has already been
                // logged (either from the menu command or the history list command.
                // We don't need to record this any further.
                if (!(victim.Node is CWizard))
                {
                    CCommandHistory.CommandExecuted(victim, -1);
                }
                victim.Node.CreatePropertyPages(lpProvider, handle);

                return(HRESULT.S_OK);
            }
            // We don't have any property pages, let's return false
            else
            {
                return(HRESULT.S_FALSE);
            }
        }// CreatePropertyPages
Пример #2
0
        }// ExpandNodeList

        void ButtonClicked(Object o, EventArgs e)
        {
            if (m_lv.SelectedIndices.Count > 0)
            {
                CCommandHistory.FireOffConsumerCommand(m_lv.SelectedIndices[0]);
            }
        }// ButtonClick
        }// onRestoreView

        internal override void TaskPadTaskNotify(Object arg, Object param, IConsole2 con, CData com)
        {
            if ((int)arg == 1)
            {
                CConfigStore.SetSetting("ShowHTMLForSharedAssem", (bool)param?"yes":"no");
                m_fShowHTMLPage = (bool)param;

                // We'll change the result object but we won't refresh our result view
                // because the user doesn't necesarily want that to happen. However,
                // the next time the user visits this node, they will see the new result
                // view
                m_oResults = m_fShowHTMLPage?(Object)m_taskPad:(Object)this;
            }
            else if ((int)arg == 0)
            {
                m_oResults = this;
                RefreshResultView();
            }
            else if ((int)arg == 2)
            {
                MenuCommand(COMMANDS.ADD_GACASSEMBLY, null);
                // Inform our Command History that we did this
                CCommandHistory.CommandExecuted(new CDO(this), COMMANDS.ADD_GACASSEMBLY);
            }
        }// TaskPadTaskNotify
Пример #4
0
        }// 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
Пример #5
0
        }// 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
Пример #6
0
        }// GetHTMLFilename

        internal override String GetHTMLFile()
        {
            String[] args = new String[2] {
                Util.Version.VersionString,
                CCommandHistory.GetFavoriteCommandsHTML()
            };
            return(GetHTMLFile(args));
        }// GetHTMLFile
Пример #7
0
        }// AddMenuItems

        //-------------------------------------------------
        // Command
        //
        // This function is called whenever an item that we
        // added to the context menus is called
        //-------------------------------------------------
        public void Command(int lCommandID, IDataObject piDataObject)
        {
            CDO item = (CDO)piDataObject;

            // Tell our command history about this
            CCommandHistory.CommandExecuted(item, lCommandID);
            item.Node.MenuCommand(lCommandID, item.Data);
        }// Command
Пример #8
0
        }// MenuCommand

        internal override void TaskPadTaskNotify(Object arg, Object param, IConsole2 con, CData com)
        {
            if ((int)arg == 0)
            {
                // We need to pop up the Create New Permission Set wizard
                MenuCommand(COMMANDS.NEW_PERMISSIONSET);
                // Inform our Command History that we did this
                CCommandHistory.CommandExecuted(new CDO(this), COMMANDS.NEW_PERMISSIONSET);
            }
        }// TaskPadTaskNotify
Пример #9
0
        }// AddMenuItems

        //-------------------------------------------------
        // Command
        //
        // This function is called whenever an item that we
        // added to the context menus is called
        //-------------------------------------------------
        public void Command(int lCommandID, IDataObject piDataObject)
        {
            CDO item = (CDO)piDataObject;

            CCommandHistory.CommandExecuted(item, lCommandID);
            if (item.Data != null)
            {
                item.Node.MenuCommand(lCommandID, item.Data);
            }
            else
            {
                item.Node.MenuCommand(lCommandID);
            }
        }// Command
Пример #10
0
        }// CGenAppTaskPad

        internal override void Notify(Object arg, Object param, IConsole2 con, CData com)
        {
            if ((int)arg == 1)
            {
                // We need to fire up the Add application wizard.
                m_myNode.MenuCommand(COMMANDS.ADD_APPLICATION);
                // Inform our Command History that we did this
                CCommandHistory.CommandExecuted(new CDO(m_myNode), COMMANDS.ADD_APPLICATION);
            }
            else if ((int)arg == 2)
            {
                m_myNode.MenuCommand(COMMANDS.FIX_APPLICATION);
                // Inform our Command History that we did this
                CCommandHistory.CommandExecuted(new CDO(m_myNode), COMMANDS.FIX_APPLICATION);
            }
        }// Notify
Пример #11
0
        }// Notify

        //-------------------------------------------------
        // Destroy
        //
        // This cleans up whatever needs to be cleaned up.
        // Normally, this would be used to release any interfaces
        // we had that traced back to the console. We can do this
        // by removing any references we have to the interfaces...
        //-------------------------------------------------
        public void Destroy()
        {
            if (m_Component != null)
            {
                CNodeManager.Shutdown();
                CResourceStore.Shutdown();
                CHTMLFileGen.Shutdown();
                CCommandHistory.Shutdown();
                m_Component = null;
                m_rn        = null;
            }

            if ((m_ucsole != null) && (Marshal.IsComObject(m_ucsole)))
            {
                Marshal.ReleaseComObject(m_ucsole);
            }
        }// Destroy
Пример #12
0
        }// CheckCurrentPermissions

        internal override void TaskPadTaskNotify(Object arg, Object param, IConsole2 con, CData com)
        {
            if ((int)arg == 0)
            {
                // We need to pop up the "Trust an App Wizard"
                MenuCommand(COMMANDS.TRUST_ASSEMBLY);
                // Inform our Command History that we did this
                CCommandHistory.CommandExecuted(new CDO(this), COMMANDS.TRUST_ASSEMBLY);
            }

            if ((int)arg == 1)
            {
                // We need to pop up the "Adjust Security Settings Wizard"
                MenuCommand(COMMANDS.ADJUST_SECURITYPOLICY);
                // Inform our Command History that we did this
                CCommandHistory.CommandExecuted(new CDO(this), COMMANDS.ADJUST_SECURITYPOLICY);
            }

            if ((int)arg == 2)
            {
                // We need to pop up the "Evaluate Assembly"
                MenuCommand(COMMANDS.EVALUATE_ASSEMBLY);
                // Inform our Command History that we did this
                CCommandHistory.CommandExecuted(new CDO(this), COMMANDS.EVALUATE_ASSEMBLY);
            }

            if ((int)arg == 3)
            {
                // We need to pop up the "Create Deployment Package Wizard"
                MenuCommand(COMMANDS.CREATE_MSI);
                // Inform our Command History that we did this
                CCommandHistory.CommandExecuted(new CDO(this), COMMANDS.CREATE_MSI);
            }

            if ((int)arg == 4)
            {
                // We need to do the reset thing
                MenuCommand(COMMANDS.RESET_POLICY);
                // Inform our Command History that we did this
                CCommandHistory.CommandExecuted(new CDO(this), COMMANDS.RESET_POLICY);
            }
        }// TaskPadTaskNotify
Пример #13
0
        }// GetListPadInfo

        //-------------------------------------------------------
        // Stuff for IExtendPropertySheet2 - This will only be called
        // on Property sheets in the result view
        //-------------------------------------------------------

        //-------------------------------------------------
        // CreatePropertyPages
        //
        // MMC calls this function when it wants a property
        // page for a specified node.
        //-------------------------------------------------
        public int CreatePropertyPages(IPropertySheetCallback lpProvider, IntPtr handle, IDataObject lpIDataObject)
        {
            // This is really a CDO in disguise
            CDO victim = (CDO)lpIDataObject;

            // See if we're asking for property pages based on a result item
            if (victim.Data != null && victim.Node.DoesResultHavePropertyPage(victim.Data))
            {
                CCommandHistory.CommandExecuted(victim, -1);
                victim.Node.CreateResultPropertyPages(lpProvider, handle, victim.Data);
            }
            // We don't have any property pages, let's return false
            else
            {
                MessageBox(0, "Got a false positive", "", 0);
                return(HRESULT.S_FALSE);
            }

            return(HRESULT.S_OK);
        }// CreatePropertyPages