Esempio n. 1
0
        internal CSingleCodeGroup(ref PolicyLevel pl, ref CodeGroup cg, bool fReadOnly)
        {
            ReadOnly       = fReadOnly;
            m_sGuid        = "E1768EA0-51D6-42ea-BA97-C9BC7F4C5CC0";
            m_sHelpSection = "";

            if (cg.Name != null && cg.Name.Length > 0)
            {
                m_sDisplayName = cg.Name;
            }
            else
            {
                m_sDisplayName = CResourceStore.GetString("CSingleCodeGroup:NoName");
            }

            m_aPropSheetPage = null;

            if (cg is UnionCodeGroup)
            {
                m_hIcon    = CResourceStore.GetHIcon("singlecodegroup_ico");
                m_oResults = new CSingleCodeGroupTaskPad(this, cg);
            }
            else
            {
                m_hIcon    = CResourceStore.GetHIcon("customcodegroup_ico");
                m_oResults = new CNonUnionCGTaskPad(this, cg);
            }

            m_cg          = cg;
            m_cgOld       = m_cg.Copy();
            m_pl          = pl;
            m_fIAmDeleted = false;
        }// CSingleCodeGroup
        }// class PropPagePairs

        internal CSharedAssemblies()
        {
            m_sGuid        = "96821C0B-CBE2-4dc9-AC52-756A3361B07F";
            m_sHelpSection = "";
            m_hIcon        = CResourceStore.GetHIcon("sharedassemblies_ico");
            DisplayName    = CResourceStore.GetString("CSharedAssemblies:DisplayName");
            Name           = "Assembly Cache";

            m_taskPad       = new CGenericTaskPad(this, "SHAREDASSEM_HTML");
            m_fReadShowHTML = false;

            m_olAssems = Fusion.ReadFusionCache();

            m_alResultPropPages = new ArrayList();


            // Set up the blank icon
            m_hBlankIcon      = CResourceStore.GetHIcon("blank_ico");
            m_iBlankIconIndex = CResourceStore.GetIconCookie(m_hBlankIcon);

            m_hGACIcon      = CResourceStore.GetHIcon("gac_ico");
            m_iGACIconIndex = CResourceStore.GetIconCookie(m_hGACIcon);

            m_hZAPIcon      = CResourceStore.GetHIcon("zap_ico");
            m_iZAPIconIndex = CResourceStore.GetIconCookie(m_hZAPIcon);

            m_fAllowMultiSelectResults = true;
        }// CSharedAssemblies
Esempio n. 3
0
        //-------------------------------------------------
        // CApplication - Constructor
        //
        // Initializes some variables, and determines the icon
        // we'll be displaying for this application.
        //-------------------------------------------------
        internal CApplication(AppFiles appInfo)
        {
            // Standard stuff we need to set for all nodes
            m_sGuid        = "C338CBF6-2F60-4e1b-8FB5-12FEAE2DD937";
            m_sHelpSection = "";
            m_appInfo      = appInfo;

            // Let's pull the path and extension off of the application filename
            // so we can display just the application name to the user

            // We're guarenteed to have at least the config file, but not necessarily the
            // application file... let's get our best name

            String sName = (m_appInfo.sAppFile.Length > 0) ? m_appInfo.sAppFile : m_appInfo.sAppConfigFile;

            // Get the file description
            FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(sName);

            if (fvi.FileDescription != null && fvi.FileDescription.Length > 0 && !fvi.FileDescription.Equals(" "))
            {
                m_sDisplayName = fvi.FileDescription;
            }
            else
            {
                String[] sWords = sName.Split(new char[] { '\\' });
                m_sDisplayName = sWords[sWords.Length - 1];
            }

            // Can't set this up until we know what our display name is
            m_oResults = new CApplicationTaskPad(this);

            // Let's try and get the icon that explorer would use to display this file
            m_hIcon = (IntPtr)(-1);
            SHFILEINFO finfo   = new SHFILEINFO();
            uint       iRetVal = 0;

            // Grab an icon for this application
            iRetVal = SHGetFileInfo(sName, 0, out finfo, 20, SHGFI.ICON | SHGFI.SMALLICON);

            // If this function returned a zero, then we know it was a failure...
            // We'll just grab a default icon
            if (iRetVal == 0)
            {
                m_hIcon   = CResourceStore.GetHIcon("application_ico");
                m_bBigPic = new Bitmap(Bitmap.FromHicon(m_hIcon), new Size(32, 32));
            }
            // We could get a valid icon from the shell
            else
            {
                m_hIcon = finfo.hIcon;
                // Obtain a cookie for this icon
                int iIconCookie = CResourceStore.StoreHIcon(m_hIcon);
                // Put this icon in MMC's image list
                CNodeManager.ConsoleImageListSetIcon(m_hIcon, iIconCookie);

                // We can also get the 'big' icon to use in the property page
                iRetVal   = SHGetFileInfo(sName, 0, out finfo, 20, SHGFI.ICON);
                m_bBigPic = new Bitmap(Bitmap.FromHicon(finfo.hIcon));
            }
        }// CApplication
Esempio n. 4
0
        //-------------------------------------------------
        // CNode - Constructor
        //
        // This transfers data for the node information structure
        // into the class and loads the node's icon.
        //-------------------------------------------------
        internal CNode()
        {
            // Zero out all the info out of the structure
            m_sGuid                          = null;
            m_sHelpSection                   = null;
            m_sDisplayName                   = null;
            m_sIDName                        = null;
            m_oResults                       = null;
            m_aPropSheetPage                 = null;
            m_hModule                        = Marshal.GetHINSTANCE(this.GetType().Module);
            m_iResultNum                     = 0;
            m_iHScopeItem                    = 0;
            m_iData                          = 0;
            m_hPropertyPageRouter            = (IntPtr)(-1);
            m_iParentHScopeItem              = -1;
            m_sPropPageTemplate              = "IDD_WFCWRAPPERPROP";
            m_fAllowMultiSelectResults       = false;
            m_fInsertedChildrenOnExpand      = false;
            m_fStartResultRefresh            = false;
            m_fWantToMakePropertyPageVisible = false;
            m_fWantToRefreshResult           = false;

            // Set up the blank icon
            m_hBlankIcon      = CResourceStore.GetHIcon("blank_ico");
            m_iBlankIconIndex = CResourceStore.GetIconCookie(m_hBlankIcon);
        }// CNode
Esempio n. 5
0
        }// onListDoubleClick

        private void AddAppToList(String sFilename, bool fShouldSelect)
        {
            // Let's try and get the icon that explorer would use to display this file
            IntPtr     hIcon   = (IntPtr)(-1);
            SHFILEINFO finfo   = new SHFILEINFO();
            uint       nRetVal = 0;

            // Grab an icon for this application
            nRetVal = SHGetFileInfo(sFilename, 0, out finfo, 20, SHGFI.ICON | SHGFI.SMALLICON);

            // If this function returned a zero, then we know it was a failure...
            // We'll just grab a default icon
            if (nRetVal == 0)
            {
                hIcon = CResourceStore.GetHIcon("application_ico");
            }

            // We could get a valid icon from the shell
            else
            {
                hIcon = finfo.hIcon;
            }


            int nIndex = m_ilIcons.Images.Count;

            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(hIcon));

            // If we had a shell icon, we should free it
            if (nRetVal != 0)
            {
                DestroyIcon(hIcon);
            }

            // Get the file description
            FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(sFilename);

            String sDescription;

            if (fvi.FileDescription != null && fvi.FileDescription.Length > 0 && !fvi.FileDescription.Equals(" "))
            {
                sDescription = fvi.FileDescription;
            }
            else
            {
                String[] sWords = sFilename.Split(new char[] { '\\' });
                sDescription = sWords[sWords.Length - 1];
            }

            // Add this app to the list
            ListViewItem lvi = new ListViewItem(new String[] { sDescription, sFilename }, nIndex);

            lvi.Focused  = fShouldSelect;
            lvi.Selected = fShouldSelect;
            m_lvApps.Focus();
            m_lvApps.Items.Add(lvi);
            // Make sure the item we just added is visible
            m_lvApps.EnsureVisible(m_lvApps.Items.Count - 1);
        }// AddAppToList
Esempio n. 6
0
 internal CRootNode()
 {
     m_sGuid        = "44598DFB-E95E-4419-B0FE-D4369829A48E";
     m_sHelpSection = "";
     m_oResults     = null;
     m_hIcon        = CResourceStore.GetHIcon("NETappicon_ico");
     DisplayName    = CResourceStore.GetString("CRootNode:DisplayName");
     Name           = ".NET Configuration";
 }// CRootNode
Esempio n. 7
0
        internal CApplicationDepends(String sAppFile)
        {
            m_sGuid        = "96821C0B-CBE2-4dc9-AC52-756A3361B07F";
            m_sHelpSection = "";
            m_hIcon        = CResourceStore.GetHIcon("sharedassemblies_ico");
            DisplayName    = CResourceStore.GetString("CApplicationDepends:DisplayName");
            Name           = "Assembly Dependencies";

            m_taskPadWaiting = new CGenericTaskPad(this, "WAITINGDEPENDASSEM_HTML");
            m_taskPad        = new CGenericTaskPad(this, "DEPENDASSEM_HTML");

            m_fIKnowMyDependencies     = false;
            m_fAllowListView           = false;
            m_fAllowMultiSelectResults = true;


            m_fReadShowHTML = false;
            m_oResults      = m_taskPadWaiting;
            m_olAssems      = null;

            m_sAppFile = sAppFile;

            // Get icons for the assemblies we show
            m_hAssemIcon      = CResourceStore.GetHIcon("gac_ico");
            m_iAssemIconIndex = CResourceStore.GetIconCookie(m_hAssemIcon);


            // If we're not managed, then don't bother trying to have our dependencies
            // found
            if (!Fusion.isManaged(m_sAppFile))
            {
                m_taskPad              = new CGenericTaskPad(this, "UNMANAGEDDEPENDASSEM_HTML");
                m_oResults             = m_taskPad;
                m_fIKnowMyDependencies = true;
            }
            else
            {
                // Get ourselves in a queue to have our dependent assemblies discovered....
                if (m_alNodes == null)
                {
                    m_alNodes = ArrayList.Synchronized(new ArrayList());
                }

                m_alNodes.Add(this);

                if (m_thread == null)
                {
                    m_thread = new Thread(new ThreadStart(DependencyFinder));
                }
                if (!m_thread.IsAlive)
                {
                    m_thread.Priority = ThreadPriority.Lowest;
                    m_thread.Start();
                }
            }
        }// CApplicationDepends
Esempio n. 8
0
 internal CGenApplications()
 {
     m_sGuid          = "5CE2BA30-BCFC-4876-AE9F-31255557BE28";
     m_sHelpSection   = "";
     m_hIcon          = CResourceStore.GetHIcon("applications_ico");
     DisplayName      = CResourceStore.GetString("CGenApplications:DisplayName");
     Name             = "Applications";
     m_aPropSheetPage = null;
     m_oResults       = new CGenAppTaskPad(this);
 }// CGenApplications
Esempio n. 9
0
        internal CComputerNode()
        {
            m_sGuid        = "B114511B-F0C4-469b-9928-674781D1B12B";
            m_sHelpSection = "";
            m_hIcon        = CResourceStore.GetHIcon("mycomputer_ico");

            m_oResults       = new CNetTaskPad(this);
            DisplayName      = CResourceStore.GetString("CComputerNode:DisplayName");
            Name             = "My Computer";
            m_aPropSheetPage = null;
        }// CComputerNodeNode
Esempio n. 10
0
        }// CRemoting(String)

        private void Init(String sConfigFilename)
        {
            m_sConfigFilename = sConfigFilename;
            m_sGuid           = "005DF24D-56B1-45d4-838F-780CEBBBFD3E";
            m_sHelpSection    = "";
            m_hIcon           = CResourceStore.GetHIcon("remoting_ico");
            m_oResults        = new CGenericTaskPad(this, "REMOTING_HTML");
            DisplayName       = CResourceStore.GetString("CRemoting:DisplayName");
            Name             = "Remoting Services";
            m_aPropSheetPage = null;
        }// CRemoting
Esempio n. 11
0
        internal CCodeGroups(ref PolicyLevel pl, bool fReadOnly)
        {
            ReadOnly = fReadOnly;

            m_sGuid          = "CA57E69B-C2E6-4791-9F03-D7C83D63C6DA";
            m_sHelpSection   = "";
            m_hIcon          = CResourceStore.GetHIcon("codegroups_ico");
            m_oResults       = new CGenericTaskPad(this, "CODEGROUPS_HTML");
            m_sDisplayName   = CResourceStore.GetString("CCodeGroups:DisplayName");
            m_aPropSheetPage = null;

            m_pl = pl;
        }// CCodeGroups
Esempio n. 12
0
        internal CPermissionSet(PolicyLevel pl, bool fReadOnly)
        {
            ReadOnly = fReadOnly;

            m_sGuid        = "4E10E9F3-0B56-416e-A715-403C418CDE6F";
            m_sHelpSection = "";
            m_hIcon        = CResourceStore.GetHIcon("permissionsets_ico");
            m_oResults     = new CPermSetTaskPad(this);

            m_sDisplayName   = CResourceStore.GetString("CPermissionSet:DisplayName");
            m_aPropSheetPage = null;
            m_pl             = pl;
        }// CPermissionSet
Esempio n. 13
0
 internal CGenSecurity()
 {
     m_sGuid                  = "D823B36A-8700-4227-8EA8-8ED4B96F4E4A";
     m_sHelpSection           = "";
     m_hIcon                  = CResourceStore.GetHIcon("security_ico");
     m_oResults               = new CGenSecTaskPad(this);
     DisplayName              = CResourceStore.GetString("CGenSecurity:DisplayName");
     Name                     = "Runtime Security Policy";
     m_aPropSheetPage         = null;
     Security.GenSecurityNode = this;
     m_fUICanRun              = true;
     m_mutex                  = new Mutex();
     m_mutexOnFlag            = new Mutex();
 }// CGenSecurity
        }// struct CustomPages

        internal CSinglePermissionSet(NamedPermissionSet permSet, PolicyLevel pl, bool fReadOnly)
        {
            base.ReadOnly   = fReadOnly;
            m_sGuid         = "E90A7E88-FB3C-4734-8245-0BEBCB4E6D63";
            m_sHelpSection  = "";
            m_fReadShowHTML = false;
            m_fDeleted      = false;
            m_pl            = pl;

            m_psetWrapper          = new CPSetWrapper();
            m_psetWrapper.PSet     = permSet;
            m_psetWrapper.PolLevel = m_pl;

            m_hIcon        = CResourceStore.GetHIcon("permissionset_ico");
            m_sDisplayName = permSet.Name;

            m_alCustomPropPages = new ArrayList();

            // Set up the icons we'll be displaying for each permission
            m_hRestrictedIcon  = CResourceStore.GetHIcon("permission_ico");
            m_iRestrictedIndex = CResourceStore.GetIconCookie(m_hRestrictedIcon);

            m_hUnRestrictedIcon  = CResourceStore.GetHIcon("permission_ico");
            m_iUnRestrictedIndex = CResourceStore.GetIconCookie(m_hUnRestrictedIcon);

            m_fReadOnlyPermissionSet = false;
            try
            {
                // This line will throw an exception if we're trying to do this with a
                // reserved permission set
                m_pl.ChangeNamedPermissionSet(permSet.Name, permSet);
            }
            catch (Exception)
            {
                m_fReadOnlyPermissionSet = true;
            }

            m_taskpad = new CSinglePermSetTaskPad(this);

            m_oResults       = m_taskpad;
            m_aPropSheetPage = null;

            // Get the permissions
            GenerateGivenPermissionsStringList();

            m_permProps = null;
        }// CSinglePermissionSet
Esempio n. 15
0
        internal CSecurityPolicy(String sPolName, PolicyLevel pl)
        {
            m_sGuid        = "FCB061F5-A43B-43b3-91B6-36249F29E60B";
            m_sHelpSection = "";

            m_aPropSheetPage = null;

            m_sPolicyName = sPolName;

            m_sDisplayName = LocalizedPolicyName;

            if (pl == null)
            {
                pl = Security.GetMachinePolicyLevelFromLabel(sPolName);
            }

            m_pl = pl;
            DiscoverModifyofPolicy();

            // Put in the icon
            if (m_sPolicyName.Equals("Enterprise"))
            {
                m_hIcon = CResourceStore.GetHIcon("enterprisepolicy_ico");
            }
            else if (m_sPolicyName.Equals("Machine"))
            {
                m_hIcon = CResourceStore.GetHIcon("machinepolicy_ico");
            }
            else if (m_sPolicyName.Equals("User"))
            {
                m_hIcon = CResourceStore.GetHIcon("userpolicy_ico");
            }



            if (ReadOnly)
            {
                m_sDisplayName = String.Format(CResourceStore.GetString("CSecurityPolicy:ReadOnlyPolicy"), LocalizedPolicyName);
            }

            m_oResults = new CSecurityPolicyTaskPad(this, m_sDisplayName, m_pl.StoreLocation, m_pl.StoreLocation, m_fReadOnly);

            m_sOriginalConfigFile = m_pl.StoreLocation;
            m_fRedo = false;
            m_fUndo = false;
        }// CSecurityPolicy
        internal CTrustedAssemblies(PolicyLevel pl, bool fReadOnly)
        {
            ReadOnly = fReadOnly;

            m_sGuid          = "E519DA92-C787-4abc-BF84-60BF9CD6A7E6";
            m_sHelpSection   = "";
            m_hIcon          = CResourceStore.GetHIcon("policyassemblies_ico");
            m_sDisplayName   = CResourceStore.GetString("CTrustedAssemblies:DisplayName");
            m_aPropSheetPage = null;
            m_pl             = pl;
            m_ol             = null;

            m_fReadShowHTML = false;


            // Set up the icon
            m_hTrustedIcon      = CResourceStore.GetHIcon("policyassembly_ico");
            m_iTrustedIconIndex = CResourceStore.GetIconCookie(m_hTrustedIcon);
        }// CTrustedAssemblies
Esempio n. 17
0
        }// CVersionPolicy (String)

        private void Setup(String sConfigFile)
        {
            m_sGuid          = "1F84E89D-6357-47c0-AA50-F1F438A7EA6E";
            m_sHelpSection   = "";
            m_hIcon          = CResourceStore.GetHIcon("configassemblies_ico");
            m_oResults       = this;
            DisplayName      = CResourceStore.GetString("CVersionPolicy:DisplayName");
            Name             = "Configured Assemblies";
            m_aPropSheetPage = null;
            m_taskPad        = new CVersionPolicyTaskPad(this, sConfigFile == null);
            m_fReadShowHTML  = false;

            m_ol          = null;
            m_sConfigFile = sConfigFile;

            m_fAllowMultiSelectResults = true;

            m_alResultPropPages = new ArrayList();

            m_hGACIcon      = CResourceStore.GetHIcon("gac_ico");
            m_iGACIconIndex = CResourceStore.GetIconCookie(m_hGACIcon);
        }// Setup
Esempio n. 18
0
        }// GetSnapinVersion

        //-------------------------------------------------
        // GetSnapinImage
        //
        // This returns the image of the snapin through
        // a reference parameter that is used in the About
        // page that is referenced from the Add/Remove snapin
        // page.
        //-------------------------------------------------
        public void GetSnapinImage(out IntPtr hAppIcon)
        {
            hAppIcon = CResourceStore.GetHIcon("NETappicon_ico");
        }// GetSnapinImage
Esempio n. 19
0
        }// Init

        internal override int InsertPropSheetPageControls()
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CEvalAssemWiz3));
            this.m_txtAssemEval               = new System.Windows.Forms.TextBox();
            this.m_tvCodegroups               = new System.Windows.Forms.TreeView();
            this.m_txtLevelEval               = new System.Windows.Forms.TextBox();
            this.m_lblAssemEval               = new System.Windows.Forms.Label();
            this.m_lblViewCodegroups          = new System.Windows.Forms.Label();
            this.m_lblLevelEval               = new System.Windows.Forms.Label();
            this.m_txtAssemEval.BorderStyle   = System.Windows.Forms.BorderStyle.None;
            this.m_txtAssemEval.Location      = ((System.Drawing.Point)(resources.GetObject("m_txtAssemEval.Location")));
            this.m_txtAssemEval.ReadOnly      = true;
            this.m_txtAssemEval.Size          = ((System.Drawing.Size)(resources.GetObject("m_txtAssemEval.Size")));
            this.m_txtAssemEval.TabStop       = false;
            m_txtAssemEval.Name               = "Assembly";
            this.m_tvCodegroups.Location      = ((System.Drawing.Point)(resources.GetObject("m_tvCodegroups.Location")));
            this.m_tvCodegroups.Size          = ((System.Drawing.Size)(resources.GetObject("m_tvCodegroups.Size")));
            this.m_tvCodegroups.TabIndex      = ((int)(resources.GetObject("m_tvCodegroups.TabIndex")));
            m_tvCodegroups.Name               = "Codegroups";
            this.m_txtLevelEval.BorderStyle   = System.Windows.Forms.BorderStyle.None;
            this.m_txtLevelEval.Location      = ((System.Drawing.Point)(resources.GetObject("m_txtLevelEval.Location")));
            this.m_txtLevelEval.ReadOnly      = true;
            this.m_txtLevelEval.Size          = ((System.Drawing.Size)(resources.GetObject("m_txtLevelEval.Size")));
            this.m_txtLevelEval.TabStop       = false;
            m_txtLevelEval.Name               = "PolicyLevel";
            this.m_lblAssemEval.Location      = ((System.Drawing.Point)(resources.GetObject("m_lblAssemEval.Location")));
            this.m_lblAssemEval.Size          = ((System.Drawing.Size)(resources.GetObject("m_lblAssemEval.Size")));
            this.m_lblAssemEval.TabIndex      = ((int)(resources.GetObject("m_lblAssemEval.TabIndex")));
            this.m_lblAssemEval.Text          = resources.GetString("m_lblAssemEval.Text");
            m_lblAssemEval.Name               = "AssemblyLabel";
            this.m_lblViewCodegroups.Location = ((System.Drawing.Point)(resources.GetObject("m_lblViewCodegroups.Location")));
            this.m_lblViewCodegroups.Size     = ((System.Drawing.Size)(resources.GetObject("m_lblViewCodegroups.Size")));
            this.m_lblViewCodegroups.TabIndex = ((int)(resources.GetObject("m_lblViewCodegroups.TabIndex")));
            this.m_lblViewCodegroups.Text     = resources.GetString("m_lblViewCodegroups.Text");
            m_lblViewCodegroups.Name          = "ViewCodegroupLabel";
            this.m_lblLevelEval.Location      = ((System.Drawing.Point)(resources.GetObject("m_lblLevelEval.Location")));
            this.m_lblLevelEval.Size          = ((System.Drawing.Size)(resources.GetObject("m_lblLevelEval.Size")));
            this.m_lblLevelEval.TabIndex      = ((int)(resources.GetObject("m_lblLevelEval.TabIndex")));
            this.m_lblLevelEval.Text          = resources.GetString("m_lblLevelEval.Text");
            m_lblLevelEval.Name               = "PolicyLevelLabel";
            PageControls.AddRange(new System.Windows.Forms.Control[] { this.m_txtLevelEval,
                                                                       this.m_lblViewCodegroups,
                                                                       this.m_tvCodegroups,
                                                                       this.m_txtAssemEval,
                                                                       this.m_lblLevelEval,
                                                                       this.m_lblAssemEval });

            // Create an image list of icons we'll be displaying
            m_ilIcons = new ImageList();
            // Keep the order of these consistant with the const's declared at the top
            // of this class
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("enterprisepolicy_ico")));
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("machinepolicy_ico")));
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("userpolicy_ico")));
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("singlecodegroup_ico")));
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("customcodegroup_ico")));
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("info_ico")));

            m_tvCodegroups.ImageList = m_ilIcons;


            return(1);
        }// InsertPropSheetPageControls
Esempio n. 20
0
        }// Init

        internal override int InsertPropSheetPageControls()
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CEvalAssemWiz2));
            this.m_lvPermissions            = new System.Windows.Forms.ListView();
            this.m_lblLevelEval             = new System.Windows.Forms.Label();
            this.m_lblHelpPerm              = new System.Windows.Forms.Label();
            this.m_txtAssemEval             = new System.Windows.Forms.TextBox();
            this.m_lblHelp                  = new System.Windows.Forms.Label();
            this.m_lblAssemEval             = new System.Windows.Forms.Label();
            this.m_lblLevelEvalVal          = new System.Windows.Forms.Label();
            this.m_btnViewPerm              = new System.Windows.Forms.Button();
            this.m_lvPermissions.Location   = ((System.Drawing.Point)(resources.GetObject("m_lvPermissions.Location")));
            this.m_lvPermissions.Size       = ((System.Drawing.Size)(resources.GetObject("m_lvPermissions.Size")));
            this.m_lvPermissions.TabIndex   = ((int)(resources.GetObject("m_lvPermissions.TabIndex")));
            m_lvPermissions.Name            = "Permissions";
            this.m_lblLevelEval.Location    = ((System.Drawing.Point)(resources.GetObject("m_lblLevelEval.Location")));
            this.m_lblLevelEval.Size        = ((System.Drawing.Size)(resources.GetObject("m_lblLevelEval.Size")));
            this.m_lblLevelEval.TabIndex    = ((int)(resources.GetObject("m_lblLevelEval.TabIndex")));
            this.m_lblLevelEval.Text        = resources.GetString("m_lblLevelEval.Text");
            m_lblLevelEval.Name             = "PolicyLevelLabel";
            this.m_lblHelpPerm.Location     = ((System.Drawing.Point)(resources.GetObject("m_lblHelpPerm.Location")));
            this.m_lblHelpPerm.Size         = ((System.Drawing.Size)(resources.GetObject("m_lblHelpPerm.Size")));
            this.m_lblHelpPerm.TabIndex     = ((int)(resources.GetObject("m_lblHelpPerm.TabIndex")));
            this.m_lblHelpPerm.Text         = resources.GetString("m_lblHelpPerm.Text");
            m_lblHelpPerm.Name              = "HelpPerm";
            this.m_txtAssemEval.Location    = ((System.Drawing.Point)(resources.GetObject("m_txtAssemEval.Location")));
            this.m_txtAssemEval.ReadOnly    = true;
            this.m_txtAssemEval.Size        = ((System.Drawing.Size)(resources.GetObject("m_txtAssemEval.Size")));
            this.m_txtAssemEval.TabStop     = false;
            this.m_txtAssemEval.Text        = resources.GetString("m_txtAssemEval.Text");
            m_txtAssemEval.Name             = "Assembly";
            this.m_lblHelp.Location         = ((System.Drawing.Point)(resources.GetObject("m_lblHelp.Location")));
            this.m_lblHelp.Size             = ((System.Drawing.Size)(resources.GetObject("m_lblHelp.Size")));
            this.m_lblHelp.TabIndex         = ((int)(resources.GetObject("m_lblHelp.TabIndex")));
            this.m_lblHelp.Text             = resources.GetString("m_lblHelp.Text");
            m_lblHelp.Name                  = "Help";
            this.m_lblAssemEval.Location    = ((System.Drawing.Point)(resources.GetObject("m_lblAssemEval.Location")));
            this.m_lblAssemEval.Size        = ((System.Drawing.Size)(resources.GetObject("m_lblAssemEval.Size")));
            this.m_lblAssemEval.TabIndex    = ((int)(resources.GetObject("m_lblAssemEval.TabIndex")));
            this.m_lblAssemEval.Text        = resources.GetString("m_lblAssemEval.Text");
            m_lblAssemEval.Name             = "AssemblyLabel";
            this.m_lblLevelEvalVal.Location = ((System.Drawing.Point)(resources.GetObject("m_lblLevelEvalVal.Location")));
            this.m_lblLevelEvalVal.Size     = ((System.Drawing.Size)(resources.GetObject("m_lblLevelEvalVal.Size")));
            this.m_lblLevelEvalVal.TabIndex = ((int)(resources.GetObject("m_lblLevelEvalVal.TabIndex")));
            this.m_lblLevelEvalVal.Text     = resources.GetString("m_lblLevelEvalVal.Text");
            m_lblLevelEvalVal.Name          = "PolicyLevel";
            this.m_btnViewPerm.Location     = ((System.Drawing.Point)(resources.GetObject("m_btnViewPerm.Location")));
            this.m_btnViewPerm.Size         = ((System.Drawing.Size)(resources.GetObject("m_btnViewPerm.Size")));
            this.m_btnViewPerm.TabIndex     = ((int)(resources.GetObject("m_btnViewPerm.TabIndex")));
            this.m_btnViewPerm.Text         = resources.GetString("m_btnViewPerm.Text");
            m_btnViewPerm.Name              = "ViewPermissions";
            PageControls.AddRange(new System.Windows.Forms.Control[] {
                this.m_lblHelpPerm,
                this.m_lblHelp,
                this.m_lvPermissions,
                this.m_btnViewPerm,
                this.m_txtAssemEval,
                this.m_lblLevelEvalVal,
                this.m_lblLevelEval,
                this.m_lblAssemEval
            });

            // Create an image list of icons we'll be displaying
            m_ilIcons = new ImageList();
            // Keep the order of these consistant with the const's declared at the top
            // of this class
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("permission_ico")));
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("permission_ico")));

            // Some customizations we've made....
            m_lvPermissions.DoubleClick += new EventHandler(onViewPermsClick);
            m_btnViewPerm.Click         += new EventHandler(onViewPermsClick);

            m_lvPermissions.SmallImageList = m_ilIcons;
            m_lvPermissions.MultiSelect    = false;
            m_lvPermissions.View           = View.Details;

            m_lvPermissions.HeaderStyle = ColumnHeaderStyle.None;
            ColumnHeader ch = new ColumnHeader();

            ch.Text  = "Permission";
            ch.Width = ((System.Drawing.Size)(resources.GetObject("m_lvPermissions.Size"))).Width - 17;
            m_lvPermissions.Columns.Add(ch);
            m_txtAssemEval.BorderStyle = BorderStyle.None;
            return(1);
        }// InsertPropSheetPageControls
Esempio n. 21
0
        }// CSingleCodeGroupPSetProp

        internal override int InsertPropSheetPageControls()
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CSingleCodeGroupPSetProp));
            this.m_btnViewPerm                     = new System.Windows.Forms.Button();
            this.m_cbPermissionSet                 = new System.Windows.Forms.ComboBox();
            this.m_lblPermissionSet                = new System.Windows.Forms.Label();
            this.m_lblHelp                         = new System.Windows.Forms.Label();
            this.m_lblHasThesePermissions          = new System.Windows.Forms.Label();
            this.m_lvPermissions                   = new System.Windows.Forms.ListView();
            this.m_btnViewPerm.Location            = ((System.Drawing.Point)(resources.GetObject("m_btnViewPerm.Location")));
            this.m_btnViewPerm.Size                = ((System.Drawing.Size)(resources.GetObject("m_btnViewPerm.Size")));
            this.m_btnViewPerm.TabIndex            = ((int)(resources.GetObject("m_btnViewPerm.TabIndex")));
            this.m_btnViewPerm.Text                = resources.GetString("m_btnViewPerm.Text");
            m_btnViewPerm.Name                     = "ViewPermission";
            this.m_cbPermissionSet.DropDownWidth   = 336;
            this.m_cbPermissionSet.Location        = ((System.Drawing.Point)(resources.GetObject("m_cgPermissionSet.Location")));
            this.m_cbPermissionSet.Size            = ((System.Drawing.Size)(resources.GetObject("m_cgPermissionSet.Size")));
            this.m_cbPermissionSet.TabIndex        = ((int)(resources.GetObject("m_cgPermissionSet.TabIndex")));
            this.m_cbPermissionSet.Text            = resources.GetString("m_cgPermissionSet.Text");
            m_cbPermissionSet.Name                 = "PermissionSet";
            this.m_lblPermissionSet.Location       = ((System.Drawing.Point)(resources.GetObject("m_lblPermissionSet.Location")));
            this.m_lblPermissionSet.Size           = ((System.Drawing.Size)(resources.GetObject("m_lblPermissionSet.Size")));
            this.m_lblPermissionSet.TabIndex       = ((int)(resources.GetObject("m_lblPermissionSet.TabIndex")));
            this.m_lblPermissionSet.Text           = resources.GetString("m_lblPermissionSet.Text");
            m_lblPermissionSet.Name                = "PermissionSetLabel";
            this.m_lblHelp.Location                = ((System.Drawing.Point)(resources.GetObject("m_lblHelp.Location")));
            this.m_lblHelp.Size                    = ((System.Drawing.Size)(resources.GetObject("m_lblHelp.Size")));
            this.m_lblHelp.TabIndex                = ((int)(resources.GetObject("m_lblHelp.TabIndex")));
            this.m_lblHelp.Text                    = resources.GetString("m_lblHelp.Text");
            m_lblHelp.Name                         = "Help";
            this.m_lblHasThesePermissions.Location = ((System.Drawing.Point)(resources.GetObject("m_lblHasThesePermissions.Location")));
            this.m_lblHasThesePermissions.Size     = ((System.Drawing.Size)(resources.GetObject("m_lblHasThesePermissions.Size")));
            this.m_lblHasThesePermissions.TabIndex = ((int)(resources.GetObject("m_lblHasThesePermissions.TabIndex")));
            this.m_lblHasThesePermissions.Text     = resources.GetString("m_lblHasThesePermissions.Text");
            m_lblHasThesePermissions.Name          = "HasThesePermissions";
            this.m_lvPermissions.Location          = ((System.Drawing.Point)(resources.GetObject("m_lvPermissions.Location")));
            this.m_lvPermissions.Size              = ((System.Drawing.Size)(resources.GetObject("m_lvPermissions.Size")));
            this.m_lvPermissions.TabIndex          = ((int)(resources.GetObject("m_lvPermissions.TabIndex")));
            m_lvPermissions.Name                   = "Permissions";
            PageControls.AddRange(new System.Windows.Forms.Control[] {
                this.m_lblPermissionSet,
                this.m_cbPermissionSet,
                this.m_lblHasThesePermissions,
                this.m_lvPermissions,
                this.m_lblHelp,
                this.m_btnViewPerm
            });

            // Now do some custom additions
            m_cbPermissionSet.DropDownStyle = ComboBoxStyle.DropDownList;

            // Create an image list of icons we'll be displaying
            m_ilIcons = new ImageList();
            // Keep the order of these consistant with the const's declared at the top
            // of this class
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("permission_ico")));
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("permission_ico")));


            m_lvPermissions.SmallImageList = m_ilIcons;
            m_lvPermissions.MultiSelect    = false;
            m_lvPermissions.View           = View.Details;

            m_lvPermissions.HeaderStyle = ColumnHeaderStyle.None;
            ColumnHeader ch = new ColumnHeader();

            ch.Text  = CResourceStore.GetString("Permission");
            ch.Width = ((System.Drawing.Size)(resources.GetObject("m_lvPermissions.Size"))).Width - 17;
            m_lvPermissions.Columns.Add(ch);

            // Fill in the data
            PutValuesinPage();

            // Now hook up the event handlers....
            m_cbPermissionSet.SelectedIndexChanged += new EventHandler(onPermissionSetChange);
            m_lvPermissions.SelectedIndexChanged   += new EventHandler(onPermissionChange);
            m_lvPermissions.DoubleClick            += new EventHandler(onViewPermsClick);
            m_btnViewPerm.Click += new EventHandler(onViewPermsClick);

            return(1);
        }// InsertPropSheetPageControls
Esempio n. 22
0
        }// CData

        //-------------------------------------------------
        // Initialize
        //
        // This function is responsible for recieving the
        // MMC Console interface, and I also have it inserting
        // all the images MMC will need to display the snapin
        //-------------------------------------------------
        public void Initialize(Object pUnknown)
        {
            try
            {
                m_ucsole          = (IConsole2)pUnknown;
                m_ucsoleNameSpace = (IConsoleNameSpace2)pUnknown;
            }
            catch (Exception)
            {
                // If this fails, it's because we're not on MMC 1.2 or later
                MessageBox(0,
                           CResourceStore.GetString("CData:RequireVersionofMMC"),
                           CResourceStore.GetString("CData:RequireVersionofMMCTitle"),
                           MB.ICONEXCLAMATION);
                return;
            }


            CNodeManager.Console = m_ucsole;
            IntPtr hWnd;

            m_ucsole.GetMainWindow(out hWnd);
            CNodeManager.MMChWnd = hWnd;

            CNodeManager.CNamespace = m_ucsoleNameSpace;

            // Now we'll add the images we need for the snapin
            IImageList il = null;

            m_ucsole.QueryScopeImageList(out il);

            // ALL icons that need to be displayed in the lefthand pane MUST be
            // 'registered' here

            if (il != null)
            {
                il.ImageListSetIcon(CResourceStore.GetHIcon("NETappicon_ico"),
                                    CResourceStore.GetIconCookie("NETappicon_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("mycomputer_ico"),
                                    CResourceStore.GetIconCookie("mycomputer_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("configassemblies_ico"),
                                    CResourceStore.GetIconCookie("configassemblies_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("enterprisepolicy_ico"),
                                    CResourceStore.GetIconCookie("enterprisepolicy_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("machinepolicy_ico"),
                                    CResourceStore.GetIconCookie("machinepolicy_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("userpolicy_ico"),
                                    CResourceStore.GetIconCookie("userpolicy_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("codegroups_ico"),
                                    CResourceStore.GetIconCookie("codegroups_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("singlecodegroup_ico"),
                                    CResourceStore.GetIconCookie("singlecodegroup_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("customcodegroup_ico"),
                                    CResourceStore.GetIconCookie("customcodegroup_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("permissionsets_ico"),
                                    CResourceStore.GetIconCookie("permissionsets_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("permissionset_ico"),
                                    CResourceStore.GetIconCookie("permissionset_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("policyassemblies_ico"),
                                    CResourceStore.GetIconCookie("policyassemblies_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("assemblies_ico"),
                                    CResourceStore.GetIconCookie("assemblies_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("sharedassemblies_ico"),
                                    CResourceStore.GetIconCookie("sharedassemblies_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("remoting_ico"),
                                    CResourceStore.GetIconCookie("remoting_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("security_ico"),
                                    CResourceStore.GetIconCookie("security_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("applications_ico"),
                                    CResourceStore.GetIconCookie("applications_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("application_ico"),
                                    CResourceStore.GetIconCookie("application_ico"));

                il.ImageListSetIcon(CResourceStore.GetHIcon("readonlypolicy_ico"),
                                    CResourceStore.GetIconCookie("readonlypolicy_ico"));
            }
        }// Initialize
Esempio n. 23
0
        }// CGeneralMachineProps

        internal override int InsertPropSheetPageControls()
        {
            m_imgLine = new PictureBox();
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CGeneralMachineProps));
            this.m_pbComputer                       = new System.Windows.Forms.PictureBox();
            this.m_lblMyComputer                    = new System.Windows.Forms.Label();
            this.m_radConcurrent                    = new System.Windows.Forms.RadioButton();
            this.m_radNormal                        = new System.Windows.Forms.RadioButton();
            this.m_lblGarbageCollector              = new System.Windows.Forms.Label();
            this.m_lblGarbageCollectorHelp          = new System.Windows.Forms.Label();
            this.m_lblSecurityHelp                  = new System.Windows.Forms.Label();
            this.m_chkUseSecurity                   = new System.Windows.Forms.CheckBox();
            this.m_pbComputer.Location              = ((System.Drawing.Point)(resources.GetObject("m_pbComputer.Location")));
            this.m_pbComputer.Size                  = ((System.Drawing.Size)(resources.GetObject("m_pbComputer.Size")));
            this.m_pbComputer.SizeMode              = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.m_pbComputer.TabIndex              = ((int)(resources.GetObject("m_pbComputer.TabIndex")));
            this.m_pbComputer.TabStop               = false;
            m_pbComputer.Name                       = "ComputerPicture";
            this.m_lblMyComputer.Location           = ((System.Drawing.Point)(resources.GetObject("m_lblMyComputer.Location")));
            this.m_lblMyComputer.Size               = ((System.Drawing.Size)(resources.GetObject("m_lblMyComputer.Size")));
            this.m_lblMyComputer.TabIndex           = ((int)(resources.GetObject("m_lblMyComputer.TabIndex")));
            this.m_lblMyComputer.Text               = resources.GetString("m_lblMyComputer.Text");
            m_lblMyComputer.Name                    = "MyComputer";
            this.m_radConcurrent.Location           = ((System.Drawing.Point)(resources.GetObject("m_radConcurrent.Location")));
            this.m_radConcurrent.Size               = ((System.Drawing.Size)(resources.GetObject("m_radConcurrent.Size")));
            this.m_radConcurrent.TabIndex           = ((int)(resources.GetObject("m_radConcurrent.TabIndex")));
            this.m_radConcurrent.Text               = resources.GetString("m_radConcurrent.Text");
            m_radConcurrent.Name                    = "Concurrent";
            this.m_radNormal.Location               = ((System.Drawing.Point)(resources.GetObject("m_radNormal.Location")));
            this.m_radNormal.Size                   = ((System.Drawing.Size)(resources.GetObject("m_radNormal.Size")));
            this.m_radNormal.TabIndex               = ((int)(resources.GetObject("m_radNormal.TabIndex")));
            this.m_radNormal.Text                   = resources.GetString("m_radNormal.Text");
            m_radNormal.Name                        = "Normal";
            this.m_lblGarbageCollector.Location     = ((System.Drawing.Point)(resources.GetObject("m_lblGarbageCollector.Location")));
            this.m_lblGarbageCollector.Size         = ((System.Drawing.Size)(resources.GetObject("m_lblGarbageCollector.Size")));
            this.m_lblGarbageCollector.TabIndex     = ((int)(resources.GetObject("m_lblGarbageCollector.TabIndex")));
            this.m_lblGarbageCollector.Text         = resources.GetString("m_lblGarbageCollector.Text");
            m_lblGarbageCollector.Name              = "GCLabel";
            this.m_lblGarbageCollectorHelp.Location = ((System.Drawing.Point)(resources.GetObject("m_lblGarbageCollectorHelp.Location")));
            this.m_lblGarbageCollectorHelp.Size     = ((System.Drawing.Size)(resources.GetObject("m_lblGarbageCollectorHelp.Size")));
            this.m_lblGarbageCollectorHelp.TabIndex = ((int)(resources.GetObject("m_lblGarbageCollectorHelp.TabIndex")));
            this.m_lblGarbageCollectorHelp.Text     = resources.GetString("m_lblGarbageCollectorHelp.Text");
            m_lblGarbageCollectorHelp.Name          = "GCHelp";

            this.m_lblSecurityHelp.Location = ((System.Drawing.Point)(resources.GetObject("m_lblSecurityHelp.Location")));
            this.m_lblSecurityHelp.Size     = ((System.Drawing.Size)(resources.GetObject("m_lblSecurityHelp.Size")));
            this.m_lblSecurityHelp.TabIndex = ((int)(resources.GetObject("m_lblSecurityHelp.TabIndex")));
            this.m_lblSecurityHelp.Text     = resources.GetString("m_lblSecurityHelp.Text");
            m_lblSecurityHelp.Name          = "SecurityHelp";
            this.m_lblSecurityHelp.Visible  = false;

            this.m_chkUseSecurity.Location = ((System.Drawing.Point)(resources.GetObject("m_chkUseSecurity.Location")));
            this.m_chkUseSecurity.Size     = ((System.Drawing.Size)(resources.GetObject("m_chkUseSecurity.Size")));
            this.m_chkUseSecurity.TabIndex = ((int)(resources.GetObject("m_chkUseSecurity.TabIndex")));
            this.m_chkUseSecurity.Text     = resources.GetString("m_chkUseSecurity.Text");
            m_chkUseSecurity.Name          = "UseSecurity";
            this.m_chkUseSecurity.Visible  = false;

            PageControls.AddRange(new System.Windows.Forms.Control[] { this.m_pbComputer,
                                                                       this.m_radNormal,
                                                                       this.m_radConcurrent,
                                                                       this.m_chkUseSecurity,
                                                                       this.m_lblGarbageCollector,
                                                                       m_lblGarbageCollectorHelp,
                                                                       m_lblSecurityHelp,
                                                                       this.m_lblMyComputer });
            this.m_pbComputer.Image = Bitmap.FromHicon(CResourceStore.GetHIcon("mycomputer_ico"));

            // Draw a line seperating that stuff
            Bitmap   bp = new Bitmap(370, 2);
            Graphics g  = Graphics.FromImage(bp);

            g.DrawLine(Pens.Black, new Point(0, 0), new Point(370, 0));
            g.DrawLine(Pens.White, new Point(0, 1), new Point(370, 1));
            m_imgLine.Location = new Point(5, 60);
            m_imgLine.Size     = new Size(370, 2);
            m_imgLine.TabIndex = 0;
            m_imgLine.TabStop  = false;
            m_imgLine.Image    = bp;
            PageControls.Add(m_imgLine);

            // Some more tweaking....
            m_radNormal.CheckedChanged           += new EventHandler(onChange);
            m_radConcurrent.CheckedChanged       += new EventHandler(onChange);
            this.m_chkUseSecurity.CheckedChanged += new System.EventHandler(onChange);


            // Fill in the data
            PutValuesinPage();

            return(1);
        }// InsertPropSheetPageControls