예제 #1
0
        }// GetCurrentPermission

        //-------------------------------------------------
        // GetAccess
        //
        // Translates a string into a MessageQueuePermissionAccess enum
        //-------------------------------------------------
        private MessageQueuePermissionAccess GetAccess(String sAccess)
        {
            MessageQueuePermissionAccess mqpa = MessageQueuePermissionAccess.None;

            if (sAccess.Equals(CResourceStore.GetString("MessageQueuePermission:Administer")))
            {
                mqpa = MessageQueuePermissionAccess.Administer;
            }
            if (sAccess.Equals(CResourceStore.GetString("MessageQueuePermission:Receive")))
            {
                mqpa = MessageQueuePermissionAccess.Receive;
            }
            if (sAccess.Equals(CResourceStore.GetString("MessageQueuePermission:Peek")))
            {
                mqpa = MessageQueuePermissionAccess.Peek;
            }
            if (sAccess.Equals(CResourceStore.GetString("MessageQueuePermission:Send")))
            {
                mqpa = MessageQueuePermissionAccess.Send;
            }
            if (sAccess.Equals(CResourceStore.GetString("MessageQueuePermission:Browse")))
            {
                mqpa = MessageQueuePermissionAccess.Browse;
            }

            return(mqpa);
        }// GetAccess
 //-------------------------------------------------
 // CConfigAssemWiz1 - Constructor
 //
 // Initializes some variables.
 // sf is a delegate that, when called, will turn on
 // the "Finish" button on the wizard
 //-------------------------------------------------
 internal CConfigAssemWiz1(CApplicationDepends appDepends)
 {
     m_sHeaderTitle    = CResourceStore.GetString("CConfigAssemWiz1:HeaderTitle");
     m_sHeaderSubTitle = CResourceStore.GetString("CConfigAssemWiz1:HeaderSubTitle");
     m_sTitle          = CResourceStore.GetString("CConfigAssemWiz1:Title");
     m_appDepends      = appDepends;
 }// CConfigAssemWiz1
예제 #3
0
        internal CDNSPermDialog(DnsPermission perm)
        {
            this.Text = CResourceStore.GetString("Dnsperm:PermName");

            m_PermControls = new CDNSPermControls(perm, this);
            Init();
        } // CDNSPermDialog
예제 #4
0
        }// PutValuesinPage

        void onBrowse(Object o, EventArgs e)
        {
            // Pop up a file dialog so the user can find an assembly
            OpenFileDialog fd = new OpenFileDialog();

            fd.Title  = CResourceStore.GetString("CEvalAssemWiz1:FDTitle");
            fd.Filter = CResourceStore.GetString("CEvalAssemWiz1:FDMask");
            System.Windows.Forms.DialogResult dr = fd.ShowDialog();
            if (dr == System.Windows.Forms.DialogResult.OK)
            {
                if (Fusion.isManaged(fd.FileName))
                {
                    m_txtFilename.Text = fd.FileName;
                    onTextChange(null, null);

                    // Get a jump on the loading of this assembly
                    if (m_tEvidence != null)
                    {
                        m_tEvidence.Abort();
                    }

                    m_tEvidence = new Thread(new ThreadStart(NewAssembly));
                    m_tEvidence.Start();
                }
                else
                {
                    MessageBox(CResourceStore.GetString("isNotManagedCode"),
                               CResourceStore.GetString("isNotManagedCodeTitle"),
                               MB.ICONEXCLAMATION);
                }
            }
        }// onBrowse
예제 #5
0
        }// InsertPropSheetPageControls

        internal bool PutValuesinPage()
        {
            m_txtAssemEval.Text = m_sAssemName;
            // Make sure this starts off enabled
            m_btnViewPerm.Enabled = true;

            m_lblLevelEvalVal.Text = CEvalAssemWizard.GetDisplayString(m_nPolicyLevel);

            // Display the various permissions in the currently selected permission set
            m_lvPermissions.Items.Clear();
            if (m_ps != null)
            {
                if (m_ps.IsUnrestricted())
                {
                    ListViewItem lvi = new ListViewItem(CResourceStore.GetString("Unrestricted"), UNRESTRICTEDIMAGEINDEX);
                    m_lvPermissions.Items.Add(lvi);
                    m_btnViewPerm.Enabled = false;
                }
                else
                {
                    IEnumerator permEnumerator = m_ps.GetEnumerator();
                    while (permEnumerator.MoveNext())
                    {
                        IPermission  perm        = (IPermission)permEnumerator.Current;
                        int          nImageIndex = DeterminePermissionIcon(perm);
                        ListViewItem lvi         = new ListViewItem(Security.GetDisplayStringForPermission(perm), nImageIndex);
                        m_lvPermissions.Items.Add(lvi);
                    }
                }
            }

            m_txtAssemEval.Select(0, 0);
            return(true);
        }// PutValuesinPage
예제 #6
0
        }// onTextChange

        void onBrowse(Object o, EventArgs e)
        {
            // Pop up a file dialog so the user can find an assembly
            OpenFileDialog fd = new OpenFileDialog();

            fd.Title  = CResourceStore.GetString("CTrustAppWiz2:ChooseAssemFDTitle");
            fd.Filter = CResourceStore.GetString("AssemFDMask");
            System.Windows.Forms.DialogResult dr = fd.ShowDialog();
            if (dr == System.Windows.Forms.DialogResult.OK)
            {
                if (Fusion.isManaged(fd.FileName))
                {
                    m_txtFilename.Text = fd.FileName;
                    // Inform our wizard that we have a new assembly for it to try and load
                    CFullTrustWizard wiz = (CFullTrustWizard)CNodeManager.GetNode(m_iCookie);
                    wiz.NewAssembly();
                }
                else
                {
                    MessageBox(CResourceStore.GetString("isNotManagedCode"),
                               CResourceStore.GetString("isNotManagedCodeTitle"),
                               MB.ICONEXCLAMATION);
                }
            }
        } // onBrowse
예제 #7
0
        }// onDelete

        internal override void AddMenuItems(ref IContextMenuCallback piCallback, ref int pInsertionAllowed)
        {
            // See if we're allowed to insert an item in the "view" section
            if (!ReadOnly && (pInsertionAllowed & (int)CCM.INSERTIONALLOWED_TOP) > 0)
            {
                // Stuff common to the top menu
                CONTEXTMENUITEM newitem = new CONTEXTMENUITEM();
                newitem.lInsertionPointID = CCM.INSERTIONPOINTID_PRIMARY_TOP;
                newitem.fFlags            = 0;
                newitem.fSpecialFlags     = 0;

                newitem.strName          = CResourceStore.GetString("CSingleCodeGroup:NewOption");
                newitem.strStatusBarText = CResourceStore.GetString("CSingleCodeGroup:NewOptionDes");
                newitem.lCommandID       = COMMANDS.CREATE_CODEGROUP;

                // Now add this item through the callback
                piCallback.AddItem(ref newitem);


                newitem.strName          = CResourceStore.GetString("CSingleCodeGroup:DuplicateOption");
                newitem.strStatusBarText = CResourceStore.GetString("CSingleCodeGroup:DuplicateOptionDes");
                newitem.lCommandID       = COMMANDS.DUPLICATE_CODEGROUP;

                // Now add this item through the callback
                piCallback.AddItem(ref newitem);
            }
        }// AddMenuItems
예제 #8
0
        }// GetNumberFromTimeString

        private String GetTimeUnitFromTimeString(String s)
        {
            int nIndex = s.Length - 1;

            while (nIndex >= 0 && !Char.IsNumber(s[nIndex]))
            {
                nIndex--;
            }

            String sUnit = s.Substring(nIndex + 1);

            if (sUnit.ToLower(CultureInfo.InvariantCulture).Equals("d"))
            {
                return(CResourceStore.GetString("Days"));
            }
            if (sUnit.ToLower(CultureInfo.InvariantCulture).Equals("m"))
            {
                return(CResourceStore.GetString("Minutes"));
            }
            if (sUnit.ToLower(CultureInfo.InvariantCulture).Equals("s"))
            {
                return(CResourceStore.GetString("Seconds"));
            }
            if (sUnit.ToLower(CultureInfo.InvariantCulture).Equals("ms"))
            {
                return(CResourceStore.GetString("Milliseconds"));
            }
            // If we don't know the time value, let's make it seconds
            return(CResourceStore.GetString("Seconds"));
        }// GetTimeUnitFromTimeString
예제 #9
0
        }// InsertPropSheetPageControls

        void onChangeWindowOption(Object o, EventArgs e)
        {
            if (m_cbWindowOptions.SelectedIndex == 0)
            {
                m_lblWindowOptionDescription.Text = CResourceStore.GetString("Uiperm:AllWinDes");
            }
            else if (m_cbWindowOptions.SelectedIndex == 1)
            {
                m_lblWindowOptionDescription.Text = CResourceStore.GetString("Uiperm:SafeTopDes");
            }
            else if (m_cbWindowOptions.SelectedIndex == 2)
            {
                m_lblWindowOptionDescription.Text = CResourceStore.GetString("Uiperm:SafeSubDes");
            }
            else if (m_cbWindowOptions.SelectedIndex == 3)
            {
                m_lblWindowOptionDescription.Text = CResourceStore.GetString("Uiperm:NoWinDes");
            }
            else
            {
                m_lblWindowOptionDescription.Text = "";
            }

            ActivateApply();
        }// onChangeWindowOption
예제 #10
0
 internal CNewPermSetWiz1(PolicyLevel pl)
 {
     m_pl              = pl;
     m_sTitle          = CResourceStore.GetString("CNewPermSetWiz1:Title");
     m_sHeaderTitle    = CResourceStore.GetString("CNewPermSetWiz1:HeaderTitle");
     m_sHeaderSubTitle = CResourceStore.GetString("CNewPermSetWiz1:HeaderSubTitle");
 }// CNewPermSetWiz1
        }// 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
예제 #12
0
        }// CGenApplications

        internal override void AddMenuItems(ref IContextMenuCallback piCallback, ref int pInsertionAllowed)
        {
            // See if we're allowed to insert an item in the "view" section
            if ((pInsertionAllowed & (int)CCM.INSERTIONALLOWED_TOP) > 0)
            {
                // Stuff common to the top menu
                CONTEXTMENUITEM newitem = new CONTEXTMENUITEM();
                newitem.lInsertionPointID = CCM.INSERTIONPOINTID_PRIMARY_TOP;
                newitem.fFlags            = 0;
                newitem.fSpecialFlags     = 0;

                newitem.strName          = CResourceStore.GetString("CGenApplications:AddApplicationOption");
                newitem.strStatusBarText = CResourceStore.GetString("CGenApplications:AddApplicationOptionDes");
                newitem.lCommandID       = COMMANDS.ADD_APPLICATION;

                // Now add this item through the callback
                piCallback.AddItem(ref newitem);


                newitem.strName          = CResourceStore.GetString("CGenApplications:FixApplicationOption");
                newitem.strStatusBarText = CResourceStore.GetString("CGenApplications:FixApplicationOptionDes");
                newitem.lCommandID       = COMMANDS.FIX_APPLICATION;

                // Now add this item through the callback
                piCallback.AddItem(ref newitem);
            }
        }// AddMenuItems
예제 #13
0
        }// ImportCodegroup

        private NamedPermissionSet ImportPermissionSet()
        {
            // We're importing a permission set
            NamedPermissionSet nps = null;

            try
            {
                SecurityElement se = SecurityXMLStuff.GetSecurityElementFromXMLFile(PermissionSetFilename);
                if (se == null)
                {
                    throw new Exception("Invalid XML");
                }

                nps = new NamedPermissionSet("Hi");
                nps.FromXml(se);

                if (nps.Name == null || nps.Name.Length == 0)
                {
                    nps.Name = Security.FindAGoodPermissionSetName(m_pl, "CustomPermissionSet");
                }

                return(nps);
            }
            catch (Exception)
            {
                MessageBox(CResourceStore.GetString("XMLNoPermSet"),
                           CResourceStore.GetString("XMLNoPermSetTitle"),
                           MB.ICONEXCLAMATION);
            }
            return(null);
        }// ImportPermissionSet
        internal CSecurityAdjustmentWiz2()
        {
            m_sTitle          = CResourceStore.GetString("CSecurityAdjustmentWiz2:Title");
            m_sHeaderTitle    = CResourceStore.GetString("CSecurityAdjustmentWiz2:HeaderTitle");
            m_sHeaderSubTitle = CResourceStore.GetString("CSecurityAdjustmentWiz2:HeaderSubTitle");

            // Set up the zone descriptions
            m_sZoneDescriptions = new String[] { CResourceStore.GetString("CSecurityAdjustmentWiz2:MyComputerDes"),
                                                 CResourceStore.GetString("CSecurityAdjustmentWiz2:IntranetDes"),
                                                 CResourceStore.GetString("CSecurityAdjustmentWiz2:InternetDes"),
                                                 CResourceStore.GetString("CSecurityAdjustmentWiz2:TrustedDes"),
                                                 CResourceStore.GetString("CSecurityAdjustmentWiz2:UntrustedDes") };

            m_sSecLevelDescriptions = new String[] {
                CResourceStore.GetString("TightSecurityDes"),
                CResourceStore.GetString("FairlyTightSecurityDes"),
                CResourceStore.GetString("FairlyLooseSecurityDes"),
                CResourceStore.GetString("LooseSecurityDes"),
                CResourceStore.GetString("CSecurityAdjustmentWiz2:Custom")
            };


            m_nDefaultLevels = new int[] { PermissionSetType.FULLTRUST,
                                           PermissionSetType.INTRANET,
                                           PermissionSetType.INTERNET,
                                           PermissionSetType.INTERNET,
                                           PermissionSetType.NONE };

            m_nZoneLevels = null;
        }// CSecurityAdjustmentWiz2
예제 #15
0
        }// CreateChildren

        internal CSinglePermissionSet AddPermissionSet(NamedPermissionSet nps)
        {
            // Make sure we have a unique permission set name
            int    nCounter = 1;
            String sBase    = nps.Name;

            while (Security.isPermissionSetNameUsed(m_pl, nps.Name))
            {
                if (nCounter == 1)
                {
                    nps.Name = String.Format(CResourceStore.GetString("CSinglePermissionSet:NewDupPermissionSet"), sBase);
                }
                else
                {
                    nps.Name = String.Format(CResourceStore.GetString("CSinglePermissionSet:NumNewDupPermissionSet"), nCounter.ToString(), sBase);
                }
                nCounter++;
            }

            // Now add the new permission set
            m_pl.AddNamedPermissionSet(nps);
            CNode node    = new CSinglePermissionSet(nps, m_pl, ReadOnly);
            int   nCookie = CNodeManager.AddNode(ref node);

            AddChild(nCookie);
            InsertSpecificChild(nCookie);
            // Return the node we created
            return((CSinglePermissionSet)node);
        } // AddPermissionSet
예제 #16
0
        }// LoadAssembly

        // This function is used to create the strings to put in the summary table
        private String GetNameOfNewPermissionLevel()
        {
            if (m_nPageToGetPermissionLevel == 3)
            {
                return(CResourceStore.GetString("CSecurityAdjustmentWiz3:FullTrustName"));
            }
            else
            {
                if (Page5.MyTrustLevel == PermissionSetType.FULLTRUST)
                {
                    return(CResourceStore.GetString("CSecurityAdjustmentWiz3:FullTrustName"));
                }
                else if (Page5.MyTrustLevel == PermissionSetType.INTERNET)
                {
                    return(CResourceStore.GetString("CSecurityAdjustmentWiz3:InternetName"));
                }
                else if (Page5.MyTrustLevel == PermissionSetType.INTRANET)
                {
                    return(CResourceStore.GetString("CSecurityAdjustmentWiz3:LocalIntranetName"));
                }
                else if (Page5.MyTrustLevel == PermissionSetType.NONE)
                {
                    return(CResourceStore.GetString("CSecurityAdjustmentWiz3:NoTrustName"));
                }
            }
            return(CResourceStore.GetString("<unknown>"));
        }// GetNameOfNewPermissionLevel
예제 #17
0
        internal CFileDialogPermPropPage(CPSetWrapper nps) :  base(nps)
        {
            IPermission perm = m_pSetWrap.PSet.GetPermission(typeof(FileDialogPermission));

            m_PermControls = new CFileDialogPermControls(perm, this);
            m_sTitle       = CResourceStore.GetString("FileDialogPerm:PermName");
        }// CFileDialogPermPropPage
        }// CNewCodeGroupWiz1

        internal override int InsertPropSheetPageControls()
        {
            base.InsertPropSheetPageControls();
            m_radCreateNew.Text = CResourceStore.GetString("CNewCodeGroupWiz1:m_radCreateNew.Text");
            m_radImportXML.Text = CResourceStore.GetString("CNewCodeGroupWiz1:m_radImportXML.Text");
            return(1);
        }// InsertPropSheetPageControls
예제 #19
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
예제 #20
0
        }// AddSetting

        public String GetPermissionString()
        {
            String s = "";

            if (fRead)
            {
                s += CResourceStore.GetString("FileIOPermission:Read");
            }
            if (fWrite)
            {
                if (s.Length > 0)
                {
                    s += CResourceStore.GetString("FileIOPerm:Seperator");
                }
                s += CResourceStore.GetString("FileIOPermission:Write");
            }
            if (fAppend)
            {
                if (s.Length > 0)
                {
                    s += CResourceStore.GetString("FileIOPerm:Seperator");
                }
                s += CResourceStore.GetString("FileIOPermission:Append");
            }
            if (fPDiscovery)
            {
                if (s.Length > 0)
                {
                    s += CResourceStore.GetString("FileIOPerm:Seperator");
                }
                s += CResourceStore.GetString("FileIOPermission:PathDiscovery");
            }

            return(s);
        } // GetPermissionString
예제 #21
0
        }// RemoveChildCodegroup

        internal override void SecurityPolicyChanged(bool fShowDialog)
        {
            if (!m_fIAmDeleted)
            {
                // We need to catch this policy change in the event that our display name
                // has changed
                if (m_cg.Name == null || m_cg.Name.Length == 0)
                {
                    m_sDisplayName = CResourceStore.GetString("CSingleCodeGroup:NoName");
                }
                else
                {
                    m_sDisplayName = m_cg.Name;
                }

                // We need to remove this node from the policy tree, then replace it
                // with the updated Codegroup
                if (Security.GetRootCodeGroupNode(m_pl) == this)
                {
                    // This is the easy case... we'll just replace the root code
                    m_pl.RootCodeGroup = m_cg;
                }
                else
                {
                    // We need to do a big deal update
                    Security.UpdateCodegroup(m_pl, this);
                }
                m_cgOld = m_cg.Copy();
                RefreshResultView();
            }
            base.SecurityPolicyChanged(fShowDialog);
        } // SecurityPolicyChanged
예제 #22
0
        internal CEventLogPermDialog(EventLogPermission perm)
        {
            this.Text = CResourceStore.GetString("EventLogPermission:PermName");

            m_PermControls = new CEventLogPermControls(perm, this);
            Init();
        } // CEventLogPermDialog
        }// AddMenuItems

        internal override void MenuCommand(int nCommandID, Object oResultItem)
        {
            if (nCommandID == COMMANDS.DUPLICATE_PERMISSIONSET)
            {
                NamedPermissionSet nps = (NamedPermissionSet)m_psetWrapper.PSet.Copy();

                String sBaseName = nps.Name;

                nps.Name = String.Format(CResourceStore.GetString("CSinglePermissionSet:PrependtoDupPSets"), nps.Name);
                int nCounter = 1;
                // make sure it's not already used
                while (Security.isPermissionSetNameUsed(m_pl, nps.Name))
                {
                    nCounter++;
                    nps.Name = String.Format(CResourceStore.GetString("CSinglePermissionSet:NumPrependtoDupPSets"), nCounter.ToString(), sBaseName);
                }


                CNode node = CNodeManager.GetNodeByHScope(ParentHScopeItem);
                CSinglePermissionSet newNode = ((CPermissionSet)node).AddPermissionSet(nps);
                newNode.SecurityPolicyChanged();
                // Put the selection on the new permission set we just created
                CNodeManager.SelectScopeItem(newNode.HScopeItem);
            }

            else if (nCommandID == COMMANDS.VIEW_PERMISSION)
            {
                int iResultItem = (int)oResultItem - 1;
                // Pop up the Dialog Box for this permission
                (new CReadOnlyPermission((IPermission)m_alPermissions[iResultItem])).ShowDialog();
            }

            else if (nCommandID == COMMANDS.ADD_PERMISSIONS)
            {
                CAddPermissionsWizard wiz = new CAddPermissionsWizard(m_psetWrapper);
                wiz.LaunchWizard(Cookie);
                if (wiz.didFinish)
                {
                    SecurityPolicyChanged();
                    GenerateGivenPermissionsStringList();
                    CNodeManager.Console.SelectScopeItem(HScopeItem);
                }
            }
            else if (nCommandID == COMMANDS.SHOW_LISTVIEW)
            {
                m_oResults = this;
                RefreshResultView();
                m_fShowHTMLPage = false;
            }

            else if (nCommandID == COMMANDS.SHOW_TASKPAD)
            {
                m_oResults      = m_taskpad;
                m_fShowHTMLPage = true;
                // The HTML pages comes displayed with this checkbox marked. Make
                // sure we update the xml setting
                CConfigStore.SetSetting("ShowHTMLForPermissionSet", "yes");
                RefreshResultView();
            }
        }// MenuCommand
예제 #24
0
        }// COleDbPermControls

        protected override DataTable CreateDataTable(DataGrid dg)
        {
            DataTable dt = new DataTable("Stuff");

            // Create the "Provider" Column
            DataColumn dcProvider = new DataColumn();

            dcProvider.ColumnName = "Provider";
            dcProvider.DataType   = typeof(String);
            dt.Columns.Add(dcProvider);

            // Now set up any column-specific behavioral stuff....
            // like not letting the checkboxes allow null, setting
            // column widths, etc.

            DataGridTableStyle    dgts          = new DataGridTableStyle();
            DataGridTextBoxColumn dgtbcProvider = new DataGridTextBoxColumn();

            dg.TableStyles.Add(dgts);
            dgts.MappingName       = "Stuff";
            dgts.RowHeadersVisible = false;
            dgts.AllowSorting      = false;

            // Set up the column info for the Path column
            dgtbcProvider.MappingName          = "Provider";
            dgtbcProvider.HeaderText           = CResourceStore.GetString("Provider");
            dgtbcProvider.Width                = ScaleWidth(CResourceStore.GetInt("OleDbPermission:ProviderColumnWidth"));
            dgtbcProvider.NullText             = "";
            dgtbcProvider.TextBox.TextChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgtbcProvider);

            return(dt);
        }// CreateDataTable
예제 #25
0
 internal CTrustAppWiz8()
 {
     m_sTitle          = CResourceStore.GetString("CTrustAppWiz8:Title");
     m_sHeaderTitle    = CResourceStore.GetString("CTrustAppWiz8:HeaderTitle");
     m_sHeaderSubTitle = CResourceStore.GetString("CTrustAppWiz8:HeaderSubTitle");
     m_sInfo           = null;
 }// CTrustAppWiz8
예제 #26
0
        }// onTextChange

        void CheckFile(Object o, CancelEventArgs e)
        {
            OpenFileDialog fd = (OpenFileDialog)o;

            try
            {
                String sFilename = fd.FileName;
                // Check to see if this is a http path....
                if (!File.Exists(sFilename))
                {
                    MessageBox.Show(String.Format(CResourceStore.GetString("CChooseAppDialog:FileNotExist"), sFilename),
                                    CResourceStore.GetString("CChooseAppDialog:FileNotExistTitle"),
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                    e.Cancel = true;
                }
            }
            catch (Exception)
            {
                MessageBox.Show(CResourceStore.GetString("CChooseAppDialog:BadFile"),
                                CResourceStore.GetString("CChooseAppDialog:BadFileTitle"),
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
                e.Cancel = true;
            }
        }// CheckFile
예제 #27
0
        }// SecurityPolicyChanged

        internal void SavePolicy(bool fUI)
        {
            if (isNoSave)
            {
                if (fUI)
                {
                    MessageBox(String.Format(CResourceStore.GetString("CSecurityPolicy:CannotSave"), m_sPolicyName),
                               CResourceStore.GetString("CSecurityPolicy:CannotSaveTitle"),
                               MB.ICONEXCLAMATION);
                }
                return;
            }

            // Refresh our root codegroup
            try
            {
                SecurityManager.SavePolicyLevel(m_pl);
                m_fUndo = true;
            }
            catch (Exception)
            {
                // Ok, we got an error somehow. This should be pretty rare, and could happen
                // if another process has the policy file locked. Inform the user and see
                // what they want to do.
                bool fSaved = false;
                bool fRetry = true;

                while (!fSaved && fRetry)
                {
                    int nRet = MessageBox(String.Format(CResourceStore.GetString("CSecurityPolicy:SaveFailedRetry"),
                                                        m_pl.StoreLocation),
                                          CResourceStore.GetString("CSecurityPolicy:SaveFailedRetryTitle"),
                                          MB.RETRYCANCEL | MB.ICONEXCLAMATION);
                    if (nRet == MB.IDRETRY)
                    {
                        try
                        {
                            SecurityManager.SavePolicyLevel(m_pl);
                            m_fUndo = true;
                            fSaved  = true;
                        }
                        catch (Exception)
                        {}
                    }
                    else
                    {
                        fRetry = false;
                    }
                }

                if (!fSaved)
                {
                    MessageBox(String.Format(CResourceStore.GetString("CSecurityPolicy:SaveFailed"),
                                             LocalizedPolicyName,
                                             m_pl.StoreLocation),
                               CResourceStore.GetString("CSecurityPolicy:SaveFailedTitle"),
                               MB.ICONEXCLAMATION);
                }
            }
        }// SavePolicy
예제 #28
0
 internal CDependAssembliesDialog(CApplicationDepends appDepends)
 {
     m_appDepends = appDepends;
     m_ol         = GenerateAssemblyList();
     PutInAssemblies();
     this.Text = CResourceStore.GetString("InheritedAssemblyDialogs:ChooseFromDepend");
 }// CFusionDialog
예제 #29
0
 internal CNewCodeGroupWiz3(PolicyLevel pl)
 {
     m_sTitle          = CResourceStore.GetString("CNewCodeGroupWiz3:Title");
     m_sHeaderTitle    = CResourceStore.GetString("CNewCodeGroupWiz3:HeaderTitle");
     m_sHeaderSubTitle = CResourceStore.GetString("CNewCodeGroupWiz3:HeaderSubTitle");
     m_pl = pl;
 }// CNewCodeGroupWiz3
예제 #30
0
        internal CEnvPermDialog(EnvironmentPermission perm)
        {
            this.Text = CResourceStore.GetString("EnvironmentPerm:PermName");

            m_PermControls = new CEnvPermControls(perm, this);
            Init();
        } // CEnvPermDialog