Inheritance: ActionsPaneExtendedItem
 protected override void OnSelectionChanged(MMC.SyncStatus status)
 {
     base.OnSelectionChanged(status);
     if (this.SelectedNodes.Count > 1)
     {
         //Prepare actions
         this.SelectionData.ActionsPaneItems.Clear();
         bool allApplications = true;
         foreach (MMC.ScopeNode scopeNode in this.SelectedNodes)
         {
             if (scopeNode as ApplicationScopeNode==null)
             {
                 allApplications = false;
             }
         }
         if (allApplications)
         {
             this.SelectionData.Update(this.SelectedNodes, true, null, null);
             //Items Hierarchy View - MMC.SyncAction
             MMC.SyncAction ItemsHVAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_ItemsHierarchicalView"), Globalization.MultilanguageResource.GetString("Menu_ItemsHierarchicalViewDescription"));
             ItemsHVAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(ItemsHVAction_Triggered);
             this.SelectionData.ActionsPaneItems.Add(ItemsHVAction);
             //Line MMC.SyncAction
             MMC.ActionSeparator lineAction1 = new MMC.ActionSeparator();
             this.SelectionData.ActionsPaneItems.Add(lineAction1);
             //Report Group
             MMC.ActionGroup reportAction = new MMC.ActionGroup(Globalization.MultilanguageResource.GetString("rptTitle"), Globalization.MultilanguageResource.GetString("rptDescription"));
             this.SelectionData.ActionsPaneItems.Add(reportAction);
             //Items Hierarchy Report - MMC.SyncAction
             MMC.SyncAction ItemsHReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg10"), Globalization.MultilanguageResource.GetString("rptTit10"));
             ItemsHReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(ItemsHReportAction_Triggered);
             reportAction.Items.Add(ItemsHReportAction);
             //Authorizations Report - MMC.SyncAction
             MMC.SyncAction AuthorizationsReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg20"), Globalization.MultilanguageResource.GetString("rptTit20"));
             AuthorizationsReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(AuthorizationsReportAction_Triggered);
             reportAction.Items.Add(AuthorizationsReportAction);
             //Effective Permissions Report Report - MMC.SyncAction
             MMC.SyncAction EffectivePermissionsReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg30"), Globalization.MultilanguageResource.GetString("rptTit30"));
             EffectivePermissionsReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(EffectivePermissionsReportAction_Triggered);
             reportAction.Items.Add(EffectivePermissionsReportAction);
             //Line MMC.SyncAction
             MMC.ActionSeparator lineAction5 = new MMC.ActionSeparator();
             this.SelectionData.ActionsPaneItems.Add(lineAction5);
             //Export - MMC.SyncAction
             MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg80"), Globalization.MultilanguageResource.GetString("Menu_Tit80"));
             exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
             this.SelectionData.ActionsPaneItems.Add(exportAction);
             //Line MMC.SyncAction
             MMC.ActionSeparator lineAction2 = new MMC.ActionSeparator();
             this.SelectionData.ActionsPaneItems.Add(lineAction2);
             //MMC.SyncAction - Delete Applications
             MMC.SyncAction deleteApplicationsAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg90"), Globalization.MultilanguageResource.GetString("Menu_Tit90"));
             if (!(((ApplicationScopeNode)this.SelectedNodes[0]).Application.Store.IAmManager))
                 deleteApplicationsAction.Enabled = false;
             deleteApplicationsAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(deleteApplicationsAction_Triggered);
             this.SelectionData.ActionsPaneItems.Add(deleteApplicationsAction);
         }
     }
 }
        protected override void OnSelectionChanged(MMC.SyncStatus status)
        {
            base.OnSelectionChanged(status);
            //Multiple delete
            if (this.SelectedNodes.Count >= 1)
            {
                //Prepare actions
                this.SelectionData.ActionsPaneItems.Clear();
                this.SelectionData.Update(this.SelectedNodes, this.SelectedNodes.Count > 1, null, null);

                //Authorizations - MMC.SyncAction
                MMC.ActionGroup authorizationsActionGroup = new MMC.ActionGroup(Globalization.MultilanguageResource.GetString("Menu_Msg30"), Globalization.MultilanguageResource.GetString("Menu_Tit30"));
                this.SelectionData.ActionsPaneItems.Add(authorizationsActionGroup);
                //Allow with delegation
                MMC.SyncAction allowWithDelegationAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Domain_AllowWithDelegation"), Globalization.MultilanguageResource.GetString("Domain_AllowWithDelegationDescription"));
                if (this.ScopeNode as ItemAuthorizationScopeNode!=null && !((ItemAuthorizationScopeNode)this.ScopeNode).Item.Application.IAmManager ||
                    this.ScopeNode as ItemDefinitionScopeNode!=null && !((ItemDefinitionScopeNode)this.ScopeNode).Item.Application.IAmManager)
                    allowWithDelegationAction.Enabled = false;
                allowWithDelegationAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(allowWithDelegationAction_Triggered);
                authorizationsActionGroup.Items.Add(allowWithDelegationAction);
                //Allow
                MMC.SyncAction allowAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Domain_Allow"), Globalization.MultilanguageResource.GetString("Domain_AllowDescription"));
                if (this.ScopeNode as ItemAuthorizationScopeNode != null && !((ItemAuthorizationScopeNode)this.ScopeNode).Item.Application.IAmManager ||
                    this.ScopeNode as ItemDefinitionScopeNode != null && !((ItemDefinitionScopeNode)this.ScopeNode).Item.Application.IAmManager)
                    allowAction.Enabled = false;
                allowAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(allowAction_Triggered);
                authorizationsActionGroup.Items.Add(allowAction);
                //Deny
                MMC.SyncAction denyAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Domain_Deny"), Globalization.MultilanguageResource.GetString("Domain_DenyDescription"));
                if (this.ScopeNode as ItemAuthorizationScopeNode != null && !((ItemAuthorizationScopeNode)this.ScopeNode).Item.Application.IAmManager ||
                    this.ScopeNode as ItemDefinitionScopeNode != null && !((ItemDefinitionScopeNode)this.ScopeNode).Item.Application.IAmManager)
                    denyAction.Enabled = false;
                denyAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(denyAction_Triggered);
                authorizationsActionGroup.Items.Add(denyAction);
                //Neutral
                MMC.SyncAction neutralAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Domain_Neutral"), Globalization.MultilanguageResource.GetString("Domain_NeutralDescription"));
                if (this.ScopeNode as ItemAuthorizationScopeNode != null && !((ItemAuthorizationScopeNode)this.ScopeNode).Item.Application.IAmManager ||
                    this.ScopeNode as ItemDefinitionScopeNode != null && !((ItemDefinitionScopeNode)this.ScopeNode).Item.Application.IAmManager)
                    neutralAction.Enabled = false;
                neutralAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(neutralAction_Triggered);
                authorizationsActionGroup.Items.Add(neutralAction);
                //Line separator
                MMC.ActionSeparator lineAction = new MMC.ActionSeparator();
                this.SelectionData.ActionsPaneItems.Add(lineAction);
                //MMC.SyncAction - Delete Authorizations
                MMC.SyncAction deleteAuthorizationsAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg40"), Globalization.MultilanguageResource.GetString("Menu_Tit40"));
                if (this.ScopeNode as ItemAuthorizationScopeNode != null && !((ItemAuthorizationScopeNode)this.ScopeNode).Item.Application.IAmManager ||
                    this.ScopeNode as ItemDefinitionScopeNode != null && !((ItemDefinitionScopeNode)this.ScopeNode).Item.Application.IAmManager)
                    deleteAuthorizationsAction.Enabled = false;
                deleteAuthorizationsAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(deleteAuthorizationsAction_Triggered);
                this.SelectionData.ActionsPaneItems.Add(deleteAuthorizationsAction);
            }
        }
Exemplo n.º 3
0
 private bool CheckForCircularReference(ActionGroup group)
 {
     if (group.Items == this)
     {
         return true;
     }
     foreach (ActionsPaneItem item in group.Items)
     {
         ActionGroup group2 = item as ActionGroup;
         if ((group2 != null) && this.CheckForCircularReference(group2))
         {
             return true;
         }
     }
     return false;
 }
        /// <summary>
        /// OnExpand method implmentation
        /// </summary>
        protected override void OnExpand(AsyncStatus status)
        {
            this.ActionsPaneHelpItems.Clear();
            this.ActionsPaneItems.Clear();
            this.EnabledStandardVerbs = StandardVerbs.Refresh;

            this.ActionsPaneItems.Add(AddUser);
            this.ActionsPaneItems.Add(new Microsoft.ManagementConsole.ActionSeparator());
            this.ActionsPaneItems.Add(FilterUser);

            ClearFilterUser.Enabled = ManagementAdminService.Filter.FilterisActive;
            this.ActionsPaneItems.Add(ClearFilterUser);

            this.ActionsPaneItems.Add(new Microsoft.ManagementConsole.ActionSeparator());
            Microsoft.ManagementConsole.ActionGroup importgrp = new Microsoft.ManagementConsole.ActionGroup("Importer", "Procédures d'import d'utilisateurs");
            importgrp.Items.Add(new Microsoft.ManagementConsole.Action("Import d'utilisateurs CSV", "Importer des utilisateur à partir d'un fichier CSV", -1, "ImportCSV"));
            importgrp.Items.Add(new Microsoft.ManagementConsole.Action("Import d'utilisateurs XML", "Importer des utilisateur à partir d'un fichier XML", -1, "ImportXML"));
            importgrp.Items.Add(new Microsoft.ManagementConsole.Action("Import d'utilisateurs Active Directory", "Importer des utilisateur à partir de ADDS", -1, "ImportADDS"));
            this.ActionsPaneItems.Add(importgrp);
            base.OnExpand(status);
        }
Exemplo n.º 5
0
        protected void RenderStorageScopeNode()
        {
            //Prepare Node
            this.DisplayName = ".NET SQL Authorization Manager";
            string connectedUserName = "******";
            if (this.storage != null)
            {
                SqlConnectionStringBuilder csb = new SqlConnectionStringBuilder(this.storage.ConnectionString);
                if (csb.IntegratedSecurity)
                    connectedUserName = ((System.Threading.Thread.CurrentPrincipal.Identity as WindowsIdentity) ?? WindowsIdentity.GetCurrent()).Name.Trim();
                else
                    connectedUserName = csb.UserID.Trim();
            }
            if (!String.IsNullOrEmpty(this.dataSource))
                this.DisplayName += String.Format(" ({0}\\{1} - {2})", this.dataSource.Trim().ToUpper(), this.initialCatalog.Trim(), connectedUserName);
            this.SubItemDisplayNames.Clear();
            this.ImageIndex = ImageIndexes.NetSqlAzManImgIdx;
            this.SelectedImageIndex = ImageIndexes.NetSqlAzManImgIdx;
            //Assign Tag
            this.Tag = storage;
            //Enable standard verbs
            this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
            //Add custom actions
            this.ActionsPaneItems.Clear();
            //Sql Store Connection String - MMC.SyncAction
            MMC.SyncAction sqlStoreConnectionStringAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg340"), Globalization.MultilanguageResource.GetString("Menu_Tit340"));
            this.ActionsPaneItems.Add(sqlStoreConnectionStringAction);
            sqlStoreConnectionStringAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(this.sqlStoreConnectionStringAction_Triggered);
            //Language - MMC.SyncAction
            MMC.ActionGroup LanguageActionGroup = new MMC.ActionGroup(Globalization.MultilanguageResource.GetString("Language_Msg10"), Globalization.MultilanguageResource.GetString("Language_Tit10"));
            this.LanguageEnglishAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Language_English"), Globalization.MultilanguageResource.GetString("Language_EnglishDescription"));
            this.LanguageItalianAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Language_Italian"), Globalization.MultilanguageResource.GetString("Language_ItalianDescription"));
            this.LanguageSpanishAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Language_Spanish"), Globalization.MultilanguageResource.GetString("Language_SpanishDescription"));
            this.LanguageAlbanianAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Language_Albanian"), Globalization.MultilanguageResource.GetString("Language_AlbanianDescription"));
            this.LanguageRussianAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Language_Russian"), Globalization.MultilanguageResource.GetString("Language_RussianDescription"));

            this.LanguageEnglishAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(LanguageEnglishAction_Triggered);
            this.LanguageItalianAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(LanguageItalianAction_Triggered);
            this.LanguageSpanishAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(LanguageSpanishAction_Triggered);
            this.LanguageAlbanianAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(LanguageAlbanianAction_Triggered);
            this.LanguageRussianAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(LanguageRussianAction_Triggered);

            LanguageActionGroup.Items.Add(this.LanguageEnglishAction);
            LanguageActionGroup.Items.Add(this.LanguageAlbanianAction);
            LanguageActionGroup.Items.Add(this.LanguageItalianAction);
            LanguageActionGroup.Items.Add(this.LanguageSpanishAction);
            LanguageActionGroup.Items.Add(this.LanguageRussianAction);

            this.ActionsPaneItems.Add(LanguageActionGroup);

            string selectedCulture = Globalization.MultilanguageResource.cultureName(Globalization.MultilanguageResource.GetCurrentCulture());
            if (selectedCulture == "Italian")
            {
                this.LanguageItalianAction_Triggered(this, null);
                this.LanguageItalianAction.Bulleted = true;
            }
            else if (selectedCulture == "Spanish")
            {
                this.LanguageSpanishAction_Triggered(this, null);
                this.LanguageSpanishAction.Bulleted = true;
            }
            else if (selectedCulture == "Albanian")
            {
                this.LanguageAlbanianAction_Triggered(this, null);
                this.LanguageAlbanianAction.Bulleted = true;
            }
            else if (selectedCulture == "Russian")
            {
                this.LanguageRussianAction_Triggered(this, null);
                this.LanguageRussianAction.Bulleted = true;
            }
            else
            {
                this.LanguageEnglishAction_Triggered(this, null);
                this.LanguageEnglishAction.Bulleted = true;
            }

            if (this.storage != null)
            {
                if (this.ViewDescriptions.Count > 1)
                    this.ViewDescriptions.RemoveAt(0);
                //Options - MMC.SyncAction
                MMC.ActionGroup optionsGroupAction = new MMC.ActionGroup(Globalization.MultilanguageResource.GetString("Menu_Msg350"), Globalization.MultilanguageResource.GetString("Menu_Tit350"));
                optionsGroupAction.ImageIndex = ImageIndexes.mnuConnectionSettingsImgIdx;

                //Mode & Logging
                MMC.SyncAction modeAndLoggingAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg550"), Globalization.MultilanguageResource.GetString("Menu_Tit550"));
                modeAndLoggingAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(modeAndLoggingAction_Triggered);
                optionsGroupAction.Items.Add(modeAndLoggingAction);

                //Auditing
                MMC.SyncAction auditingAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg560"), Globalization.MultilanguageResource.GetString("Menu_Tit560"));
                auditingAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(auditingAction_Triggered);
                optionsGroupAction.Items.Add(auditingAction);

                this.ActionsPaneItems.Add(optionsGroupAction);

                //Line MMC.SyncAction
                MMC.ActionSeparator lineAction1 = new MMC.ActionSeparator();
                this.ActionsPaneItems.Add(lineAction1);

                //Invalidate WCF Cache Service
                MMC.SyncAction invalidateWCFCacheServiceAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg570"), Globalization.MultilanguageResource.GetString("Menu_Tit570"));
                invalidateWCFCacheServiceAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(this.invalidateWCFCacheServiceAction_Triggered);
                this.ActionsPaneItems.Add(invalidateWCFCacheServiceAction);

                //Line MMC.SyncAction
                MMC.ActionSeparator lineAction11 = new MMC.ActionSeparator();
                this.ActionsPaneItems.Add(lineAction11);
                //New Store - MMC.SyncAction
                MMC.SyncAction createNewStoreAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg360"), Globalization.MultilanguageResource.GetString("Menu_Tit360"));
                bool imadmin;
                try
                {
                    imadmin = this.storage.IAmAdmin;
                }
                catch
                {
                    imadmin = false;
                }
                if (!imadmin)
                    createNewStoreAction.Enabled = false;
                createNewStoreAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(this.newStoreAction_Triggered);
                this.ActionsPaneItems.Add(createNewStoreAction);
                //Line MMC.SyncAction
                MMC.ActionSeparator lineAction2 = new MMC.ActionSeparator();
                this.ActionsPaneItems.Add(lineAction2);
                //Import - MMC.SyncAction
                MMC.SyncAction importAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg370"), Globalization.MultilanguageResource.GetString("Menu_Tit370"));

                if (!imadmin)
                    importAction.Enabled = false;
                importAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(importAction_Triggered);
                this.ActionsPaneItems.Add(importAction);
                //Export - MMC.SyncAction
                MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg380"), Globalization.MultilanguageResource.GetString("Menu_Tit380"));
                exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
                this.ActionsPaneItems.Add(exportAction);
                //Import From Microsoft Authorization Manager - MMC.SyncAction
                MMC.SyncAction importAzManAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg390"), Globalization.MultilanguageResource.GetString("Menu_Tit390"));
                if (!imadmin)
                    importAzManAction.Enabled = false;
                importAzManAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(importAzManAction_Triggered);
                this.ActionsPaneItems.Add(importAzManAction);
            }
        }
Exemplo n.º 6
0
        protected void RenderStorageScopeNode()
        {
            //Prepare Node
            this.DisplayName = ".NET SQL Authorization Manager";
            string connectedUserName = "******";

            if (this.storage != null)
            {
                SqlConnectionStringBuilder csb = new SqlConnectionStringBuilder(this.storage.ConnectionString);
                if (csb.IntegratedSecurity)
                {
                    connectedUserName = ((System.Threading.Thread.CurrentPrincipal.Identity as WindowsIdentity) ?? WindowsIdentity.GetCurrent()).Name.Trim();
                }
                else
                {
                    connectedUserName = csb.UserID.Trim();
                }
            }
            if (!String.IsNullOrEmpty(this.dataSource))
            {
                this.DisplayName += String.Format(" ({0}\\{1} - {2})", this.dataSource.Trim().ToUpper(), this.initialCatalog.Trim(), connectedUserName);
            }
            this.SubItemDisplayNames.Clear();
            this.ImageIndex         = ImageIndexes.NetSqlAzManImgIdx;
            this.SelectedImageIndex = ImageIndexes.NetSqlAzManImgIdx;
            //Assign Tag
            this.Tag = storage;
            //Enable standard verbs
            this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
            //Add custom actions
            this.ActionsPaneItems.Clear();
            //Sql Store Connection String - MMC.SyncAction
            MMC.SyncAction sqlStoreConnectionStringAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg340"), Globalization.MultilanguageResource.GetString("Menu_Tit340"));
            this.ActionsPaneItems.Add(sqlStoreConnectionStringAction);
            sqlStoreConnectionStringAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(this.sqlStoreConnectionStringAction_Triggered);
            //Language - MMC.SyncAction
            MMC.ActionGroup LanguageActionGroup = new MMC.ActionGroup(Globalization.MultilanguageResource.GetString("Language_Msg10"), Globalization.MultilanguageResource.GetString("Language_Tit10"));
            this.LanguageEnglishAction  = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Language_English"), Globalization.MultilanguageResource.GetString("Language_EnglishDescription"));
            this.LanguageItalianAction  = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Language_Italian"), Globalization.MultilanguageResource.GetString("Language_ItalianDescription"));
            this.LanguageSpanishAction  = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Language_Spanish"), Globalization.MultilanguageResource.GetString("Language_SpanishDescription"));
            this.LanguageAlbanianAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Language_Albanian"), Globalization.MultilanguageResource.GetString("Language_AlbanianDescription"));
            this.LanguageRussianAction  = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Language_Russian"), Globalization.MultilanguageResource.GetString("Language_RussianDescription"));

            this.LanguageEnglishAction.Triggered  += new MMC.SyncAction.SyncActionEventHandler(LanguageEnglishAction_Triggered);
            this.LanguageItalianAction.Triggered  += new MMC.SyncAction.SyncActionEventHandler(LanguageItalianAction_Triggered);
            this.LanguageSpanishAction.Triggered  += new MMC.SyncAction.SyncActionEventHandler(LanguageSpanishAction_Triggered);
            this.LanguageAlbanianAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(LanguageAlbanianAction_Triggered);
            this.LanguageRussianAction.Triggered  += new MMC.SyncAction.SyncActionEventHandler(LanguageRussianAction_Triggered);

            LanguageActionGroup.Items.Add(this.LanguageEnglishAction);
            LanguageActionGroup.Items.Add(this.LanguageAlbanianAction);
            LanguageActionGroup.Items.Add(this.LanguageItalianAction);
            LanguageActionGroup.Items.Add(this.LanguageSpanishAction);
            LanguageActionGroup.Items.Add(this.LanguageRussianAction);

            this.ActionsPaneItems.Add(LanguageActionGroup);

            string selectedCulture = Globalization.MultilanguageResource.cultureName(Globalization.MultilanguageResource.GetCurrentCulture());

            if (selectedCulture == "Italian")
            {
                this.LanguageItalianAction_Triggered(this, null);
                this.LanguageItalianAction.Bulleted = true;
            }
            else if (selectedCulture == "Spanish")
            {
                this.LanguageSpanishAction_Triggered(this, null);
                this.LanguageSpanishAction.Bulleted = true;
            }
            else if (selectedCulture == "Albanian")
            {
                this.LanguageAlbanianAction_Triggered(this, null);
                this.LanguageAlbanianAction.Bulleted = true;
            }
            else if (selectedCulture == "Russian")
            {
                this.LanguageRussianAction_Triggered(this, null);
                this.LanguageRussianAction.Bulleted = true;
            }
            else
            {
                this.LanguageEnglishAction_Triggered(this, null);
                this.LanguageEnglishAction.Bulleted = true;
            }

            if (this.storage != null)
            {
                if (this.ViewDescriptions.Count > 1)
                {
                    this.ViewDescriptions.RemoveAt(0);
                }
                //Options - MMC.SyncAction
                MMC.ActionGroup optionsGroupAction = new MMC.ActionGroup(Globalization.MultilanguageResource.GetString("Menu_Msg350"), Globalization.MultilanguageResource.GetString("Menu_Tit350"));
                optionsGroupAction.ImageIndex = ImageIndexes.mnuConnectionSettingsImgIdx;

                //Mode & Logging
                MMC.SyncAction modeAndLoggingAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg550"), Globalization.MultilanguageResource.GetString("Menu_Tit550"));
                modeAndLoggingAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(modeAndLoggingAction_Triggered);
                optionsGroupAction.Items.Add(modeAndLoggingAction);

                //Auditing
                MMC.SyncAction auditingAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg560"), Globalization.MultilanguageResource.GetString("Menu_Tit560"));
                auditingAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(auditingAction_Triggered);
                optionsGroupAction.Items.Add(auditingAction);

                this.ActionsPaneItems.Add(optionsGroupAction);

                //Line MMC.SyncAction
                MMC.ActionSeparator lineAction1 = new MMC.ActionSeparator();
                this.ActionsPaneItems.Add(lineAction1);

                //Invalidate WCF Cache Service
                MMC.SyncAction invalidateWCFCacheServiceAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg570"), Globalization.MultilanguageResource.GetString("Menu_Tit570"));
                invalidateWCFCacheServiceAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(this.invalidateWCFCacheServiceAction_Triggered);
                this.ActionsPaneItems.Add(invalidateWCFCacheServiceAction);


                //Line MMC.SyncAction
                MMC.ActionSeparator lineAction11 = new MMC.ActionSeparator();
                this.ActionsPaneItems.Add(lineAction11);
                //New Store - MMC.SyncAction
                MMC.SyncAction createNewStoreAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg360"), Globalization.MultilanguageResource.GetString("Menu_Tit360"));
                bool           imadmin;
                try
                {
                    imadmin = this.storage.IAmAdmin;
                }
                catch
                {
                    imadmin = false;
                }
                if (!imadmin)
                {
                    createNewStoreAction.Enabled = false;
                }
                createNewStoreAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(this.newStoreAction_Triggered);
                this.ActionsPaneItems.Add(createNewStoreAction);
                //Line MMC.SyncAction
                MMC.ActionSeparator lineAction2 = new MMC.ActionSeparator();
                this.ActionsPaneItems.Add(lineAction2);
                //Import - MMC.SyncAction
                MMC.SyncAction importAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg370"), Globalization.MultilanguageResource.GetString("Menu_Tit370"));

                if (!imadmin)
                {
                    importAction.Enabled = false;
                }
                importAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(importAction_Triggered);
                this.ActionsPaneItems.Add(importAction);
                //Export - MMC.SyncAction
                MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg380"), Globalization.MultilanguageResource.GetString("Menu_Tit380"));
                exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
                this.ActionsPaneItems.Add(exportAction);
                //Import From Microsoft Authorization Manager - MMC.SyncAction
                MMC.SyncAction importAzManAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg390"), Globalization.MultilanguageResource.GetString("Menu_Tit390"));
                if (!imadmin)
                {
                    importAzManAction.Enabled = false;
                }
                importAzManAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(importAzManAction_Triggered);
                this.ActionsPaneItems.Add(importAzManAction);
            }
        }
        protected void RenderApplication()
        {
            //Prepare Node
            string fixedserverrole;
            if (this.application.IAmAdmin) fixedserverrole = "Admin";
            else if (this.application.IAmManager) fixedserverrole = "Manager";
            else if (this.application.IAmUser) fixedserverrole = "User";
            else fixedserverrole = "Reader";
            this.DisplayName = String.Format("{0} ({1})", this.application.Name, fixedserverrole);
            this.SubItemDisplayNames.Clear();
            this.SubItemDisplayNames.AddRange(
                new string[] {
                                application.Description,
                                application.ApplicationId.ToString()});

            this.ImageIndex = ImageIndexes.ApplicationImgIdx;
            this.SelectedImageIndex = ImageIndexes.ApplicationImgIdx;
            //Assign Tag
            this.Tag = application;
            //Enable standard verbs
            if (this.application.Store.IAmManager)
                this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh | MMC.StandardVerbs.Delete;
            else
                this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
            //Add custom actions
            this.ActionsPaneItems.Clear();
            //Application Properties - MMC.SyncAction
            MMC.SyncAction applicationPropertiesAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg230"), Globalization.MultilanguageResource.GetString("Menu_Tit230"));
            applicationPropertiesAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(applicationPropertiesAction_Triggered);
            this.ActionsPaneItems.Add(applicationPropertiesAction);
            //Line MMC.SyncAction
            MMC.ActionSeparator lineAction1 = new MMC.ActionSeparator();
            this.ActionsPaneItems.Add(lineAction1);
            //Items Hierarchy View - MMC.SyncAction
            MMC.SyncAction ItemsHVAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_ItemsHierarchicalView"), Globalization.MultilanguageResource.GetString("Menu_ItemsHierarchicalViewDescription"));
            ItemsHVAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(ItemsHVAction_Triggered);
            this.ActionsPaneItems.Add(ItemsHVAction);
            //Line MMC.SyncAction
            MMC.ActionSeparator lineAction3 = new MMC.ActionSeparator();
            this.ActionsPaneItems.Add(lineAction3);
            if (this.application.Store.Storage.Mode == NetSqlAzManMode.Developer)
            {
                //Generate CheckAccessHelper - MMC.SyncAction
                MMC.SyncAction gcahAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg240"), Globalization.MultilanguageResource.GetString("Menu_Tit240"));
                gcahAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(gcahAction_Triggered);
                this.ActionsPaneItems.Add(gcahAction);
                //CheckAccessTest - MMC.SyncAction
                MMC.SyncAction checkAccessTestAction = new MMC.SyncAction("Check Access Test", "Check Access Test");
                checkAccessTestAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(checkAccessTestAction_Triggered);
                this.ActionsPaneItems.Add(checkAccessTestAction);
                //Line MMC.SyncAction
                MMC.ActionSeparator lineAction4 = new MMC.ActionSeparator();
                this.ActionsPaneItems.Add(lineAction4);
            }
            //Report Group
            MMC.ActionGroup reportAction = new MMC.ActionGroup(Globalization.MultilanguageResource.GetString("rptTitle"), Globalization.MultilanguageResource.GetString("rptDescription"));
            this.ActionsPaneItems.Add(reportAction);
            //Items Hierarchy Report - MMC.SyncAction
            MMC.SyncAction ItemsHReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg10"), Globalization.MultilanguageResource.GetString("rptTit10"));
            ItemsHReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(ItemsHReportAction_Triggered);
            reportAction.Items.Add(ItemsHReportAction);
            //Authorizations Report - MMC.SyncAction
            MMC.SyncAction AuthorizationsReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg20"), Globalization.MultilanguageResource.GetString("rptTit20"));
            AuthorizationsReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(AuthorizationsReportAction_Triggered);
            reportAction.Items.Add(AuthorizationsReportAction);
            //Authorizations Report - MMC.SyncAction
            MMC.SyncAction EffectivePermissionsReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg30"), Globalization.MultilanguageResource.GetString("rptTit30"));
            EffectivePermissionsReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(EffectivePermissionsReportAction_Triggered);
            reportAction.Items.Add(EffectivePermissionsReportAction);
            //Line MMC.SyncAction
            MMC.ActionSeparator lineAction5 = new MMC.ActionSeparator();
            this.ActionsPaneItems.Add(lineAction5);
            //Import - MMC.SyncAction
            MMC.SyncAction importAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg250"), Globalization.MultilanguageResource.GetString("Menu_Tit250"));
            if (!this.application.IAmManager)
                importAction.Enabled = false;
            importAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(importAction_Triggered);
            this.ActionsPaneItems.Add(importAction);
            //Export - MMC.SyncAction
            MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg260"), Globalization.MultilanguageResource.GetString("Menu_Tit260"));
            exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
            this.ActionsPaneItems.Add(exportAction);
            //Adding fixed children
            this.Children.Clear();
            this.Children.AddRange(
                new MMC.ScopeNode[] { new ApplicationGroupsScopeNode(this.application),
                                  new ItemDefinitionsScopeNode(this.application),
                                  new ItemAuthorizationsScopeNode(this.application) });
            /*System.Windows.Forms.Application.DoEvents();*/
        }
        protected void RenderApplication()
        {
            //Prepare Node
            string fixedserverrole;

            if (this.application.IAmAdmin)
            {
                fixedserverrole = "Admin";
            }
            else if (this.application.IAmManager)
            {
                fixedserverrole = "Manager";
            }
            else if (this.application.IAmUser)
            {
                fixedserverrole = "User";
            }
            else
            {
                fixedserverrole = "Reader";
            }
            this.DisplayName = String.Format("{0} ({1})", this.application.Name, fixedserverrole);
            this.SubItemDisplayNames.Clear();
            this.SubItemDisplayNames.AddRange(
                new string[] {
                application.Description,
                application.ApplicationId.ToString()
            });

            this.ImageIndex         = ImageIndexes.ApplicationImgIdx;
            this.SelectedImageIndex = ImageIndexes.ApplicationImgIdx;
            //Assign Tag
            this.Tag = application;
            //Enable standard verbs
            if (this.application.Store.IAmManager)
            {
                this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh | MMC.StandardVerbs.Delete;
            }
            else
            {
                this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
            }
            //Add custom actions
            this.ActionsPaneItems.Clear();
            //Application Properties - MMC.SyncAction
            MMC.SyncAction applicationPropertiesAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg230"), Globalization.MultilanguageResource.GetString("Menu_Tit230"));
            applicationPropertiesAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(applicationPropertiesAction_Triggered);
            this.ActionsPaneItems.Add(applicationPropertiesAction);
            //Line MMC.SyncAction
            MMC.ActionSeparator lineAction1 = new MMC.ActionSeparator();
            this.ActionsPaneItems.Add(lineAction1);
            //Items Hierarchy View - MMC.SyncAction
            MMC.SyncAction ItemsHVAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_ItemsHierarchicalView"), Globalization.MultilanguageResource.GetString("Menu_ItemsHierarchicalViewDescription"));
            ItemsHVAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(ItemsHVAction_Triggered);
            this.ActionsPaneItems.Add(ItemsHVAction);
            //Line MMC.SyncAction
            MMC.ActionSeparator lineAction3 = new MMC.ActionSeparator();
            this.ActionsPaneItems.Add(lineAction3);
            if (this.application.Store.Storage.Mode == NetSqlAzManMode.Developer)
            {
                //Generate CheckAccessHelper - MMC.SyncAction
                MMC.SyncAction gcahAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg240"), Globalization.MultilanguageResource.GetString("Menu_Tit240"));
                gcahAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(gcahAction_Triggered);
                this.ActionsPaneItems.Add(gcahAction);
                //CheckAccessTest - MMC.SyncAction
                MMC.SyncAction checkAccessTestAction = new MMC.SyncAction("Check Access Test", "Check Access Test");
                checkAccessTestAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(checkAccessTestAction_Triggered);
                this.ActionsPaneItems.Add(checkAccessTestAction);
                //Line MMC.SyncAction
                MMC.ActionSeparator lineAction4 = new MMC.ActionSeparator();
                this.ActionsPaneItems.Add(lineAction4);
            }
            //Report Group
            MMC.ActionGroup reportAction = new MMC.ActionGroup(Globalization.MultilanguageResource.GetString("rptTitle"), Globalization.MultilanguageResource.GetString("rptDescription"));
            this.ActionsPaneItems.Add(reportAction);
            //Items Hierarchy Report - MMC.SyncAction
            MMC.SyncAction ItemsHReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg10"), Globalization.MultilanguageResource.GetString("rptTit10"));
            ItemsHReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(ItemsHReportAction_Triggered);
            reportAction.Items.Add(ItemsHReportAction);
            //Authorizations Report - MMC.SyncAction
            MMC.SyncAction AuthorizationsReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg20"), Globalization.MultilanguageResource.GetString("rptTit20"));
            AuthorizationsReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(AuthorizationsReportAction_Triggered);
            reportAction.Items.Add(AuthorizationsReportAction);
            //Authorizations Report - MMC.SyncAction
            MMC.SyncAction EffectivePermissionsReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg30"), Globalization.MultilanguageResource.GetString("rptTit30"));
            EffectivePermissionsReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(EffectivePermissionsReportAction_Triggered);
            reportAction.Items.Add(EffectivePermissionsReportAction);
            //Line MMC.SyncAction
            MMC.ActionSeparator lineAction5 = new MMC.ActionSeparator();
            this.ActionsPaneItems.Add(lineAction5);
            //Import - MMC.SyncAction
            MMC.SyncAction importAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg250"), Globalization.MultilanguageResource.GetString("Menu_Tit250"));
            if (!this.application.IAmManager)
            {
                importAction.Enabled = false;
            }
            importAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(importAction_Triggered);
            this.ActionsPaneItems.Add(importAction);
            //Export - MMC.SyncAction
            MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg260"), Globalization.MultilanguageResource.GetString("Menu_Tit260"));
            exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
            this.ActionsPaneItems.Add(exportAction);
            //Adding fixed children
            this.Children.Clear();
            this.Children.AddRange(
                new MMC.ScopeNode[] { new ApplicationGroupsScopeNode(this.application),
                                      new ItemDefinitionsScopeNode(this.application),
                                      new ItemAuthorizationsScopeNode(this.application) });
            /*System.Windows.Forms.Application.DoEvents();*/
        }
 protected override void OnSelectionChanged(MMC.SyncStatus status)
 {
     base.OnSelectionChanged(status);
     if (this.SelectedNodes.Count > 1)
     {
         //Prepare actions
         this.SelectionData.ActionsPaneItems.Clear();
         bool allApplications = true;
         foreach (MMC.ScopeNode scopeNode in this.SelectedNodes)
         {
             if (scopeNode as ApplicationScopeNode == null)
             {
                 allApplications = false;
             }
         }
         if (allApplications)
         {
             this.SelectionData.Update(this.SelectedNodes, true, null, null);
             //Items Hierarchy View - MMC.SyncAction
             MMC.SyncAction ItemsHVAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_ItemsHierarchicalView"), Globalization.MultilanguageResource.GetString("Menu_ItemsHierarchicalViewDescription"));
             ItemsHVAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(ItemsHVAction_Triggered);
             this.SelectionData.ActionsPaneItems.Add(ItemsHVAction);
             //Line MMC.SyncAction
             MMC.ActionSeparator lineAction1 = new MMC.ActionSeparator();
             this.SelectionData.ActionsPaneItems.Add(lineAction1);
             //Report Group
             MMC.ActionGroup reportAction = new MMC.ActionGroup(Globalization.MultilanguageResource.GetString("rptTitle"), Globalization.MultilanguageResource.GetString("rptDescription"));
             this.SelectionData.ActionsPaneItems.Add(reportAction);
             //Items Hierarchy Report - MMC.SyncAction
             MMC.SyncAction ItemsHReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg10"), Globalization.MultilanguageResource.GetString("rptTit10"));
             ItemsHReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(ItemsHReportAction_Triggered);
             reportAction.Items.Add(ItemsHReportAction);
             //Authorizations Report - MMC.SyncAction
             MMC.SyncAction AuthorizationsReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg20"), Globalization.MultilanguageResource.GetString("rptTit20"));
             AuthorizationsReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(AuthorizationsReportAction_Triggered);
             reportAction.Items.Add(AuthorizationsReportAction);
             //Effective Permissions Report Report - MMC.SyncAction
             MMC.SyncAction EffectivePermissionsReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg30"), Globalization.MultilanguageResource.GetString("rptTit30"));
             EffectivePermissionsReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(EffectivePermissionsReportAction_Triggered);
             reportAction.Items.Add(EffectivePermissionsReportAction);
             //Line MMC.SyncAction
             MMC.ActionSeparator lineAction5 = new MMC.ActionSeparator();
             this.SelectionData.ActionsPaneItems.Add(lineAction5);
             //Export - MMC.SyncAction
             MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg80"), Globalization.MultilanguageResource.GetString("Menu_Tit80"));
             exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
             this.SelectionData.ActionsPaneItems.Add(exportAction);
             //Line MMC.SyncAction
             MMC.ActionSeparator lineAction2 = new MMC.ActionSeparator();
             this.SelectionData.ActionsPaneItems.Add(lineAction2);
             //MMC.SyncAction - Delete Applications
             MMC.SyncAction deleteApplicationsAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg90"), Globalization.MultilanguageResource.GetString("Menu_Tit90"));
             if (!(((ApplicationScopeNode)this.SelectedNodes[0]).Application.Store.IAmManager))
             {
                 deleteApplicationsAction.Enabled = false;
             }
             deleteApplicationsAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(deleteApplicationsAction_Triggered);
             this.SelectionData.ActionsPaneItems.Add(deleteApplicationsAction);
         }
     }
 }
        protected override void OnSelectionChanged(MMC.SyncStatus status)
        {
            base.OnSelectionChanged(status);
            //Multiple delete
            if (this.SelectedNodes.Count >= 1)
            {
                //Prepare actions
                this.SelectionData.ActionsPaneItems.Clear();
                this.SelectionData.Update(this.SelectedNodes, this.SelectedNodes.Count > 1, null, null);

                //Authorizations - MMC.SyncAction
                MMC.ActionGroup authorizationsActionGroup = new MMC.ActionGroup(Globalization.MultilanguageResource.GetString("Menu_Msg30"), Globalization.MultilanguageResource.GetString("Menu_Tit30"));
                this.SelectionData.ActionsPaneItems.Add(authorizationsActionGroup);
                //Allow with delegation
                MMC.SyncAction allowWithDelegationAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Domain_AllowWithDelegation"), Globalization.MultilanguageResource.GetString("Domain_AllowWithDelegationDescription"));
                if (this.ScopeNode as ItemAuthorizationScopeNode != null && !((ItemAuthorizationScopeNode)this.ScopeNode).Item.Application.IAmManager ||
                    this.ScopeNode as ItemDefinitionScopeNode != null && !((ItemDefinitionScopeNode)this.ScopeNode).Item.Application.IAmManager)
                {
                    allowWithDelegationAction.Enabled = false;
                }
                allowWithDelegationAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(allowWithDelegationAction_Triggered);
                authorizationsActionGroup.Items.Add(allowWithDelegationAction);
                //Allow
                MMC.SyncAction allowAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Domain_Allow"), Globalization.MultilanguageResource.GetString("Domain_AllowDescription"));
                if (this.ScopeNode as ItemAuthorizationScopeNode != null && !((ItemAuthorizationScopeNode)this.ScopeNode).Item.Application.IAmManager ||
                    this.ScopeNode as ItemDefinitionScopeNode != null && !((ItemDefinitionScopeNode)this.ScopeNode).Item.Application.IAmManager)
                {
                    allowAction.Enabled = false;
                }
                allowAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(allowAction_Triggered);
                authorizationsActionGroup.Items.Add(allowAction);
                //Deny
                MMC.SyncAction denyAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Domain_Deny"), Globalization.MultilanguageResource.GetString("Domain_DenyDescription"));
                if (this.ScopeNode as ItemAuthorizationScopeNode != null && !((ItemAuthorizationScopeNode)this.ScopeNode).Item.Application.IAmManager ||
                    this.ScopeNode as ItemDefinitionScopeNode != null && !((ItemDefinitionScopeNode)this.ScopeNode).Item.Application.IAmManager)
                {
                    denyAction.Enabled = false;
                }
                denyAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(denyAction_Triggered);
                authorizationsActionGroup.Items.Add(denyAction);
                //Neutral
                MMC.SyncAction neutralAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Domain_Neutral"), Globalization.MultilanguageResource.GetString("Domain_NeutralDescription"));
                if (this.ScopeNode as ItemAuthorizationScopeNode != null && !((ItemAuthorizationScopeNode)this.ScopeNode).Item.Application.IAmManager ||
                    this.ScopeNode as ItemDefinitionScopeNode != null && !((ItemDefinitionScopeNode)this.ScopeNode).Item.Application.IAmManager)
                {
                    neutralAction.Enabled = false;
                }
                neutralAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(neutralAction_Triggered);
                authorizationsActionGroup.Items.Add(neutralAction);
                //Line separator
                MMC.ActionSeparator lineAction = new MMC.ActionSeparator();
                this.SelectionData.ActionsPaneItems.Add(lineAction);
                //MMC.SyncAction - Delete Authorizations
                MMC.SyncAction deleteAuthorizationsAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg40"), Globalization.MultilanguageResource.GetString("Menu_Tit40"));
                if (this.ScopeNode as ItemAuthorizationScopeNode != null && !((ItemAuthorizationScopeNode)this.ScopeNode).Item.Application.IAmManager ||
                    this.ScopeNode as ItemDefinitionScopeNode != null && !((ItemDefinitionScopeNode)this.ScopeNode).Item.Application.IAmManager)
                {
                    deleteAuthorizationsAction.Enabled = false;
                }
                deleteAuthorizationsAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(deleteAuthorizationsAction_Triggered);
                this.SelectionData.ActionsPaneItems.Add(deleteAuthorizationsAction);
            }
        }
Exemplo n.º 11
0
        protected void RenderStoreScopeNode()
        {
            //Prepare node
            string fixedserverrole;

            if (this.store.IAmAdmin)
            {
                fixedserverrole = "Admin";
            }
            else if (this.store.IAmManager)
            {
                fixedserverrole = "Manager";
            }
            else if (this.store.IAmUser)
            {
                fixedserverrole = "User";
            }
            else
            {
                fixedserverrole = "Reader";
            }
            this.DisplayName = String.Format("{0} ({1})", this.store.Name, fixedserverrole);
            this.SubItemDisplayNames.Clear();
            this.SubItemDisplayNames.AddRange(
                new string[] {
                store.Description,
                store.StoreId.ToString()
            });
            this.ImageIndex         = ImageIndexes.StoreImgIdx;
            this.SelectedImageIndex = ImageIndexes.StoreImgIdx;
            //Assign Tag
            this.Tag = store;
            //Enable standard verbs
            if (this.store.IAmAdmin)
            {
                this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh | MMC.StandardVerbs.Delete;
            }
            else
            {
                this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
            }
            //Add custom actions
            //Store Properties - MMC.SyncAction
            this.ActionsPaneItems.Clear();
            MMC.SyncAction storePropertiesAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg470"), Globalization.MultilanguageResource.GetString("Menu_Tit470"));
            this.ActionsPaneItems.Add(storePropertiesAction);
            storePropertiesAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(storePropertiesAction_Triggered);
            //Line MMC.SyncAction
            MMC.ActionSeparator lineAction2 = new MMC.ActionSeparator();
            this.ActionsPaneItems.Add(lineAction2);
            //Create New Application - MMC.SyncAction
            MMC.SyncAction createNewApplicationAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg480"), Globalization.MultilanguageResource.GetString("Menu_Tit480"));
            if (!this.store.IAmManager)
            {
                createNewApplicationAction.Enabled = false;
            }
            createNewApplicationAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(newApplicationAction_Triggered);
            this.ActionsPaneItems.Add(createNewApplicationAction);
            //Line MMC.SyncAction
            MMC.ActionSeparator lineAction3 = new MMC.ActionSeparator();
            this.ActionsPaneItems.Add(lineAction3);
            //Items Hierarchy View - MMC.SyncAction
            MMC.SyncAction ItemsHVAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_ItemsHierarchicalView"), Globalization.MultilanguageResource.GetString("Menu_ItemsHierarchicalViewDescription"));
            ItemsHVAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(ItemsHVAction_Triggered);
            this.ActionsPaneItems.Add(ItemsHVAction);
            //Line MMC.SyncAction
            MMC.ActionSeparator lineAction4 = new MMC.ActionSeparator();
            this.ActionsPaneItems.Add(lineAction4);
            //Report Group
            MMC.ActionGroup reportAction = new MMC.ActionGroup(Globalization.MultilanguageResource.GetString("rptTitle"), Globalization.MultilanguageResource.GetString("rptDescription"));
            this.ActionsPaneItems.Add(reportAction);
            //Items Hierarchy Report - MMC.SyncAction
            MMC.SyncAction ItemsHReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg10"), Globalization.MultilanguageResource.GetString("rptTit10"));
            ItemsHReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(ItemsHReportAction_Triggered);
            reportAction.Items.Add(ItemsHReportAction);
            //Authorizations Report - MMC.SyncAction
            MMC.SyncAction AuthorizationsReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg20"), Globalization.MultilanguageResource.GetString("rptTit20"));
            AuthorizationsReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(AuthorizationsReportAction_Triggered);
            reportAction.Items.Add(AuthorizationsReportAction);
            //Effective Permissions Report - MMC.SyncAction
            MMC.SyncAction EffectivePermissionsReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg30"), Globalization.MultilanguageResource.GetString("rptTit30"));
            EffectivePermissionsReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(EffectivePermissionsReportAction_Triggered);
            reportAction.Items.Add(EffectivePermissionsReportAction);
            //Line MMC.SyncAction
            MMC.ActionSeparator lineAction5 = new MMC.ActionSeparator();
            this.ActionsPaneItems.Add(lineAction5);
            //Import - MMC.SyncAction
            MMC.SyncAction importAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg490"), Globalization.MultilanguageResource.GetString("Menu_Tit490"));
            if (!this.store.IAmManager)
            {
                importAction.Enabled = false;
            }
            importAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(importAction_Triggered);
            this.ActionsPaneItems.Add(importAction);
            //Export - MMC.SyncAction
            MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg500"), Globalization.MultilanguageResource.GetString("Menu_Tit500"));
            exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
            this.ActionsPaneItems.Add(exportAction);
        }
Exemplo n.º 12
0
 protected void RenderStoreScopeNode()
 {
     //Prepare node
     string fixedserverrole;
     if (this.store.IAmAdmin) fixedserverrole = "Admin";
     else if (this.store.IAmManager) fixedserverrole = "Manager";
     else if (this.store.IAmUser) fixedserverrole = "User";
     else fixedserverrole = "Reader";
     this.DisplayName = String.Format("{0} ({1})", this.store.Name, fixedserverrole);
     this.SubItemDisplayNames.Clear();
     this.SubItemDisplayNames.AddRange(
         new string[] {
                         store.Description,
                         store.StoreId.ToString()});
     this.ImageIndex = ImageIndexes.StoreImgIdx;
     this.SelectedImageIndex = ImageIndexes.StoreImgIdx;
     //Assign Tag
     this.Tag = store;
     //Enable standard verbs
     if (this.store.IAmAdmin)
         this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh | MMC.StandardVerbs.Delete;
     else
         this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
     //Add custom actions
     //Store Properties - MMC.SyncAction
     this.ActionsPaneItems.Clear();
     MMC.SyncAction storePropertiesAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg470"), Globalization.MultilanguageResource.GetString("Menu_Tit470"));
     this.ActionsPaneItems.Add(storePropertiesAction);
     storePropertiesAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(storePropertiesAction_Triggered);
     //Line MMC.SyncAction
     MMC.ActionSeparator lineAction2 = new MMC.ActionSeparator();
     this.ActionsPaneItems.Add(lineAction2);
     //Create New Application - MMC.SyncAction
     MMC.SyncAction createNewApplicationAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg480"), Globalization.MultilanguageResource.GetString("Menu_Tit480"));
     if (!this.store.IAmManager)
         createNewApplicationAction.Enabled = false;
     createNewApplicationAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(newApplicationAction_Triggered);
     this.ActionsPaneItems.Add(createNewApplicationAction);
     //Line MMC.SyncAction
     MMC.ActionSeparator lineAction3 = new MMC.ActionSeparator();
     this.ActionsPaneItems.Add(lineAction3);
     //Items Hierarchy View - MMC.SyncAction
     MMC.SyncAction ItemsHVAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_ItemsHierarchicalView"), Globalization.MultilanguageResource.GetString("Menu_ItemsHierarchicalViewDescription"));
     ItemsHVAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(ItemsHVAction_Triggered);
     this.ActionsPaneItems.Add(ItemsHVAction);
     //Line MMC.SyncAction
     MMC.ActionSeparator lineAction4 = new MMC.ActionSeparator();
     this.ActionsPaneItems.Add(lineAction4);
     //Report Group
     MMC.ActionGroup reportAction = new MMC.ActionGroup(Globalization.MultilanguageResource.GetString("rptTitle"), Globalization.MultilanguageResource.GetString("rptDescription"));
     this.ActionsPaneItems.Add(reportAction);
     //Items Hierarchy Report - MMC.SyncAction
     MMC.SyncAction ItemsHReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg10"), Globalization.MultilanguageResource.GetString("rptTit10"));
     ItemsHReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(ItemsHReportAction_Triggered);
     reportAction.Items.Add(ItemsHReportAction);
     //Authorizations Report - MMC.SyncAction
     MMC.SyncAction AuthorizationsReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg20"), Globalization.MultilanguageResource.GetString("rptTit20"));
     AuthorizationsReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(AuthorizationsReportAction_Triggered);
     reportAction.Items.Add(AuthorizationsReportAction);
     //Effective Permissions Report - MMC.SyncAction
     MMC.SyncAction EffectivePermissionsReportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("rptMsg30"), Globalization.MultilanguageResource.GetString("rptTit30"));
     EffectivePermissionsReportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(EffectivePermissionsReportAction_Triggered);
     reportAction.Items.Add(EffectivePermissionsReportAction);
     //Line MMC.SyncAction
     MMC.ActionSeparator lineAction5 = new MMC.ActionSeparator();
     this.ActionsPaneItems.Add(lineAction5);
     //Import - MMC.SyncAction
     MMC.SyncAction importAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg490"), Globalization.MultilanguageResource.GetString("Menu_Tit490"));
     if (!this.store.IAmManager)
         importAction.Enabled = false;
     importAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(importAction_Triggered);
     this.ActionsPaneItems.Add(importAction);
     //Export - MMC.SyncAction
     MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg500"), Globalization.MultilanguageResource.GetString("Menu_Tit500"));
     exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
     this.ActionsPaneItems.Add(exportAction);
 }