Inheritance: ActionBase
 protected void RenderApplicationGroups()
 {
     //Prepare Node
     this.DisplayName = Globalization.MultilanguageResource.GetString("ListView_Msg20");
     this.SubItemDisplayNames.Clear();
     this.SubItemDisplayNames.Add(Globalization.MultilanguageResource.GetString("Folder_Msg10"));
     this.ImageIndex         = ImageIndexes.ApplicationGroupsImgIdx;
     this.SelectedImageIndex = ImageIndexes.ApplicationGroupsImgIdx;
     //Assign Tag
     this.Tag = application;
     //Enable standard verbs
     this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
     //Add custom actions
     this.ActionsPaneItems.Clear();
     //New Application Group - MMC.SyncAction
     MMC.SyncAction newApplicationGroupAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg210"), Globalization.MultilanguageResource.GetString("Menu_Tit210"));
     if (!this.application.IAmManager)
     {
         newApplicationGroupAction.Enabled = false;
     }
     newApplicationGroupAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(newApplicationGroupAction_Triggered);
     this.ActionsPaneItems.Add(newApplicationGroupAction);
     //Line MMC.SyncAction
     MMC.ActionSeparator lineAction1 = new MMC.ActionSeparator();
     this.ActionsPaneItems.Add(lineAction1);
     //Import - MMC.SyncAction
     MMC.SyncAction importAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg220"), Globalization.MultilanguageResource.GetString("Menu_Tit220"));
     if (!this.application.IAmManager)
     {
         importAction.Enabled = false;
     }
     importAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(importAction_Triggered);
     this.ActionsPaneItems.Add(importAction);
     /*System.Windows.Forms.Application.DoEvents();*/
 }
 protected void RenderStoreGroups()
 {
     //Prepare Node
     this.DisplayName = Globalization.MultilanguageResource.GetString("Folder_Msg90");
     this.SubItemDisplayNames.Clear();
     this.SubItemDisplayNames.Add(Globalization.MultilanguageResource.GetString("Folder_Tit90"));
     this.ImageIndex         = ImageIndexes.StoreGroupsImgIdx;
     this.SelectedImageIndex = ImageIndexes.StoreGroupsImgIdx;
     //Assign Tag
     this.Tag = store;
     //Enable standard verbs
     this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
     //Add custom actions
     this.ActionsPaneItems.Clear();
     //New Store Group - MMC.SyncAction
     MMC.SyncAction newStoreGroupAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg440"), Globalization.MultilanguageResource.GetString("Menu_Tit440"));
     if (!this.store.IAmManager)
     {
         newStoreGroupAction.Enabled = false;
     }
     newStoreGroupAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(newStoreGroupAction_Triggered);
     this.ActionsPaneItems.Add(newStoreGroupAction);
     //Line MMC.SyncAction
     MMC.ActionSeparator lineAction1 = new MMC.ActionSeparator();
     this.ActionsPaneItems.Add(lineAction1);
     //Import - MMC.SyncAction
     MMC.SyncAction importAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg450"), Globalization.MultilanguageResource.GetString("Menu_Msg460"));
     if (!this.store.IAmManager)
     {
         importAction.Enabled = false;
     }
     importAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(importAction_Triggered);
     this.ActionsPaneItems.Add(importAction);
 }
Ejemplo n.º 3
0
 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, true, null, null);
         //Export - MMC.SyncAction
         MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg130"), Globalization.MultilanguageResource.GetString("Menu_Tit130"));
         exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
         this.SelectionData.ActionsPaneItems.Add(exportAction);
         //MMC.SyncAction - Delete Stores
         MMC.SyncAction deleteStoresAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg140"), Globalization.MultilanguageResource.GetString("Menu_Tit140"));
         bool           canDelete          = true;
         foreach (StoreScopeNode ssn in this.SelectedNodes)
         {
             if (!ssn.Store.IAmAdmin)
             {
                 canDelete = false;
                 break;
             }
         }
         deleteStoresAction.Enabled    = canDelete;
         deleteStoresAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(deleteStoresAction_Triggered);
         this.SelectionData.ActionsPaneItems.Add(deleteStoresAction);
     }
 }
 protected internal void RenderItemAuthorizationScopeNode()
 {
     //Prepare Node
     this.DisplayName = this.item.Name;
     this.SubItemDisplayNames.Clear();
     this.SubItemDisplayNames.AddRange(
         new string[] {
                         item.Description,
                         item.ItemId.ToString()});
     switch (this.item.ItemType)
     {
         case ItemType.Role:
             this.ImageIndex = this.SelectedImageIndex = ImageIndexes.RoleImgIdx;
             break;
         case ItemType.Task:
             this.ImageIndex = this.SelectedImageIndex = ImageIndexes.TaskImgIdx;
             break;
         case ItemType.Operation:
             this.ImageIndex = this.SelectedImageIndex = ImageIndexes.OperationImgIdx;
             break;
     }
     //Assign Tag
     this.Tag = item;
     //Enable standard verbs
     this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
     //Add custom actions
     this.ActionsPaneItems.Clear();
     //Item Authorization - MMC.SyncAction
     MMC.SyncAction manageAuthorizationsAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg540"), Globalization.MultilanguageResource.GetString("Menu_Tit540"));
     this.ActionsPaneItems.Add(manageAuthorizationsAction);
     manageAuthorizationsAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(manageAuthorizationsAction_Triggered);
     /*System.Windows.Forms.Application.DoEvents();*/
 }
Ejemplo n.º 5
0
 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, true, null, null);
         //Export - MMC.SyncAction
         MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg130"), Globalization.MultilanguageResource.GetString("Menu_Tit130"));
         exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
         this.SelectionData.ActionsPaneItems.Add(exportAction);
         //MMC.SyncAction - Delete Stores
         MMC.SyncAction deleteStoresAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg140"), Globalization.MultilanguageResource.GetString("Menu_Tit140"));
         bool canDelete = true;
         foreach (StoreScopeNode ssn in this.SelectedNodes)
         {
             if (!ssn.Store.IAmAdmin)
             {
                 canDelete = false;
                 break;
             }
         }
         deleteStoresAction.Enabled = canDelete;
         deleteStoresAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(deleteStoresAction_Triggered);
         this.SelectionData.ActionsPaneItems.Add(deleteStoresAction);
     }
 }
Ejemplo n.º 6
0
 protected void RenderItemDefinitions()
 {
     //Prepare Node
     this.DisplayName = Globalization.MultilanguageResource.GetString("Folder_Msg30");
     this.SubItemDisplayNames.Clear();
     this.SubItemDisplayNames.Add(Globalization.MultilanguageResource.GetString("Folder_Tit30"));
     this.ImageIndex         = ImageIndexes.ItemsImgIdx;
     this.SelectedImageIndex = ImageIndexes.ItemsImgIdx;
     //Assign Tag
     this.Tag = application;
     //Enable standard verbs
     this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
     //Add custom actions
     this.ActionsPaneItems.Clear();
     //Line MMC.SyncAction
     MMC.ActionSeparator lineAction1 = new MMC.ActionSeparator();
     this.ActionsPaneItems.Add(lineAction1);
     //Import - MMC.SyncAction
     MMC.SyncAction importAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg300"), Globalization.MultilanguageResource.GetString("Menu_Tit300"));
     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_Msg310"), Globalization.MultilanguageResource.GetString("Menu_Tit310"));
     exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
     this.ActionsPaneItems.Add(exportAction);
 }
 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 void RenderItemDefinitionScopeNode()
        {
            //Prepare Node
            this.DisplayName = item.Name;
            this.SubItemDisplayNames.Clear();
            this.SubItemDisplayNames.AddRange(
                new string[] {
                item.Description,
                item.ItemId.ToString()
            });
            switch (this.item.ItemType)
            {
            case ItemType.Role:
                this.ImageIndex = this.SelectedImageIndex = ImageIndexes.RoleImgIdx;
                break;

            case ItemType.Task:
                this.ImageIndex = this.SelectedImageIndex = ImageIndexes.TaskImgIdx;
                break;

            case ItemType.Operation:
                this.ImageIndex = this.SelectedImageIndex = ImageIndexes.OperationImgIdx;
                break;
            }
            //Assign Tag
            this.Tag = item;
            //Enable standard verbs
            if (this.item.Application.IAmManager)
            {
                this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh | MMC.StandardVerbs.Delete;
            }
            else
            {
                this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
            }
            //Add custom actions
            this.ActionsPaneItems.Clear();
            //Item Properties - MMC.SyncAction
            string itemTypeName = String.Empty;

            MMC.SyncAction itemDefinitionPropertiesAction = null;
            switch (this.item.ItemType)
            {
            case ItemType.Role:
                itemDefinitionPropertiesAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("ListView_Msg60"), Globalization.MultilanguageResource.GetString("ListView_Tit60"));
                break;

            case ItemType.Task:
                itemDefinitionPropertiesAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("ListView_Msg70"), Globalization.MultilanguageResource.GetString("ListView_Tit70"));
                break;

            case ItemType.Operation:
                itemDefinitionPropertiesAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("ListView_Msg80"), Globalization.MultilanguageResource.GetString("ListView_Tit80"));
                break;
            }
            itemDefinitionPropertiesAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(itemDefinitionPropertiesAction_Triggered);
            this.ActionsPaneItems.Add(itemDefinitionPropertiesAction);
        }
        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);
            }
        }
Ejemplo n.º 10
0
 protected override void OnSyncAction(SyncAction action, SyncStatus status)
 {
     if (action == this.UpdateCheckAction)
     {
         try
         {
             OnCheckForUpdate(status);
         }
         catch (Exception ex)
         {
             ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
             this.SnapIn.Console.ShowDialog(exForm);
         }
     }
 }
Ejemplo n.º 11
0
 protected void RenderApplicationGroupScopeNode()
 {
     this.DisplayName = this.applicationGroup.Name;
     this.SubItemDisplayNames.Clear();
     this.SubItemDisplayNames.AddRange(
         new string[] {
         this.applicationGroup.Description,
         this.applicationGroup.GroupType.ToString(),
         this.applicationGroup.SID.StringValue
     });
     this.ImageIndex         = this.applicationGroup.GroupType == GroupType.Basic ? ImageIndexes.ApplicationGroupBasicImgIdx : ImageIndexes.ApplicationGroupLDAPImgIdx;
     this.SelectedImageIndex = this.ImageIndex;
     //Assign Tag
     this.Tag = this.applicationGroup;
     //Enable standard verbs
     if (this.applicationGroup.Application.IAmManager)
     {
         this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh | MMC.StandardVerbs.Delete;
     }
     else
     {
         this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
     }
     //Add custom actions
     //MMC.SyncAction - Application Group Properties
     this.ActionsPaneItems.Clear();
     MMC.SyncAction applicationGroupPropertiesAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg160"), Globalization.MultilanguageResource.GetString("Menu_Tit160"));
     applicationGroupPropertiesAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(applicationGroupPropertiesAction_Triggered);
     this.ActionsPaneItems.Add(applicationGroupPropertiesAction);
     //Line MMC.SyncAction
     MMC.ActionSeparator lineAction1 = new MMC.ActionSeparator();
     this.ActionsPaneItems.Add(lineAction1);
     //Line MMC.SyncAction
     MMC.ActionSeparator lineAction2 = new MMC.ActionSeparator();
     this.ActionsPaneItems.Add(lineAction2);
     //Export - MMC.SyncAction
     MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg170"), Globalization.MultilanguageResource.GetString("Menu_Tit170"));
     exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
     this.ActionsPaneItems.Add(exportAction);
     /*System.Windows.Forms.Application.DoEvents();*/
 }
 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, true, null, null);
         //Export - MMC.SyncAction
         MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg10"), Globalization.MultilanguageResource.GetString("Menu_Tit10"));
         exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
         this.SelectionData.ActionsPaneItems.Add(exportAction);
         //MMC.SyncAction - Delete Stores
         MMC.SyncAction deleteApplicationGroupsAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg20"), Globalization.MultilanguageResource.GetString("Menu_Tit20"));
         if (!(((ApplicationGroupScopeNode)this.SelectedNodes[0]).ApplicationGroup.Application.IAmManager))
             deleteApplicationGroupsAction.Enabled = false;
         deleteApplicationGroupsAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(deleteApplicationGroupsAction_Triggered);
         this.SelectionData.ActionsPaneItems.Add(deleteApplicationGroupsAction);
     }
 }
 protected void RenderTaskDefinitions()
 {
     //Prepare Node
     this.DisplayName = Globalization.MultilanguageResource.GetString("Folder_Msg120");
     this.SubItemDisplayNames.Clear();
     this.SubItemDisplayNames.Add(Globalization.MultilanguageResource.GetString("Folder_Tit120"));
     this.ImageIndex         = ImageIndexes.ItemsImgIdx;
     this.SelectedImageIndex = ImageIndexes.ItemsImgIdx;
     //Assign Tag
     this.Tag = application;
     //Enable standard verbs
     this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
     //Add custom actions
     this.ActionsPaneItems.Clear();
     //New Item - MMC.SyncAction
     MMC.SyncAction newTaskAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg530"), Globalization.MultilanguageResource.GetString("Menu_Tit530"));
     if (!this.application.IAmManager)
     {
         newTaskAction.Enabled = false;
     }
     newTaskAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(newTaskDefinitionAction_Triggered);
     this.ActionsPaneItems.Add(newTaskAction);
 }
Ejemplo n.º 14
0
 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, true, null, null);
         //Export - MMC.SyncAction
         MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg10"), Globalization.MultilanguageResource.GetString("Menu_Tit10"));
         exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
         this.SelectionData.ActionsPaneItems.Add(exportAction);
         //MMC.SyncAction - Delete Stores
         MMC.SyncAction deleteApplicationGroupsAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg20"), Globalization.MultilanguageResource.GetString("Menu_Tit20"));
         if (!(((ApplicationGroupScopeNode)this.SelectedNodes[0]).ApplicationGroup.Application.IAmManager))
         {
             deleteApplicationGroupsAction.Enabled = false;
         }
         deleteApplicationGroupsAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(deleteApplicationGroupsAction_Triggered);
         this.SelectionData.ActionsPaneItems.Add(deleteApplicationGroupsAction);
     }
 }
        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, true, null, null);
                if (this.SelectedNodes[0] as RoleDefinitionsScopeNode != null ||
                    this.SelectedNodes[0] as TaskDefinitionsScopeNode != null ||
                    this.SelectedNodes[0] as OperationDefinitionsScopeNode != null ||
                    this.SelectedNodes[0] as RoleAuthorizationsScopeNode != null ||
                    this.SelectedNodes[0] as TaskAuthorizationsScopeNode != null ||
                    this.SelectedNodes[0] as OperationAuthorizationsScopeNode != null)
                {
                    return;
                }
                else
                {
                    //Export - MMC.SyncAction
                    MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg60"), Globalization.MultilanguageResource.GetString("Menu_Tit60"));
                    exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
                    this.SelectionData.ActionsPaneItems.Add(exportAction);
                    //MMC.SyncAction - Delete Stores
                    MMC.SyncAction deleteItemDefinitionsAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg70"), Globalization.MultilanguageResource.GetString("Menu_Tit70"));

                    if (this.SelectedNodes[0] as ItemDefinitionScopeNode != null && !(((ItemDefinitionScopeNode)this.SelectedNodes[0]).Item.Application.IAmManager) ||
                        this.SelectedNodes[0] as ItemAuthorizationScopeNode != null && !(((ItemAuthorizationScopeNode)this.SelectedNodes[0]).Item.Application.IAmManager))
                    {
                        deleteItemDefinitionsAction.Enabled = false;
                    }
                    deleteItemDefinitionsAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(deleteItemDefinitionsAction_Triggered);
                    this.SelectionData.ActionsPaneItems.Add(deleteItemDefinitionsAction);
                }
            }
        }
Ejemplo n.º 16
0
        protected internal void RenderItemAuthorizationScopeNode()
        {
            //Prepare Node
            this.DisplayName = this.item.Name;
            this.SubItemDisplayNames.Clear();
            this.SubItemDisplayNames.AddRange(
                new string[] {
                item.Description,
                item.ItemId.ToString()
            });
            switch (this.item.ItemType)
            {
            case ItemType.Role:
                this.ImageIndex = this.SelectedImageIndex = ImageIndexes.RoleImgIdx;
                break;

            case ItemType.Task:
                this.ImageIndex = this.SelectedImageIndex = ImageIndexes.TaskImgIdx;
                break;

            case ItemType.Operation:
                this.ImageIndex = this.SelectedImageIndex = ImageIndexes.OperationImgIdx;
                break;
            }
            //Assign Tag
            this.Tag = item;
            //Enable standard verbs
            this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
            //Add custom actions
            this.ActionsPaneItems.Clear();
            //Item Authorization - MMC.SyncAction
            MMC.SyncAction manageAuthorizationsAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg540"), Globalization.MultilanguageResource.GetString("Menu_Tit540"));
            this.ActionsPaneItems.Add(manageAuthorizationsAction);
            manageAuthorizationsAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(manageAuthorizationsAction_Triggered);
            /*System.Windows.Forms.Application.DoEvents();*/
        }
        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, true, null, null);
                if (this.SelectedNodes[0] as RoleDefinitionsScopeNode != null ||
                    this.SelectedNodes[0] as TaskDefinitionsScopeNode != null ||
                    this.SelectedNodes[0] as OperationDefinitionsScopeNode != null ||
                    this.SelectedNodes[0] as RoleAuthorizationsScopeNode != null ||
                    this.SelectedNodes[0] as TaskAuthorizationsScopeNode != null ||
                    this.SelectedNodes[0] as OperationAuthorizationsScopeNode != null)
                {
                    return;
                }
                else
                {
                    //Export - MMC.SyncAction
                    MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg60"), Globalization.MultilanguageResource.GetString("Menu_Tit60"));
                    exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
                    this.SelectionData.ActionsPaneItems.Add(exportAction);
                    //MMC.SyncAction - Delete Stores
                    MMC.SyncAction deleteItemDefinitionsAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg70"), Globalization.MultilanguageResource.GetString("Menu_Tit70"));

                    if (this.SelectedNodes[0] as ItemDefinitionScopeNode != null && !(((ItemDefinitionScopeNode)this.SelectedNodes[0]).Item.Application.IAmManager) ||
                        this.SelectedNodes[0] as ItemAuthorizationScopeNode != null && !(((ItemAuthorizationScopeNode)this.SelectedNodes[0]).Item.Application.IAmManager))
                        deleteItemDefinitionsAction.Enabled = false;
                    deleteItemDefinitionsAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(deleteItemDefinitionsAction_Triggered);
                    this.SelectionData.ActionsPaneItems.Add(deleteItemDefinitionsAction);
                }
            }
        }
Ejemplo n.º 18
0
 /// <summary>
 /// Called when an action is triggered for the node. Derived classes should override this method to provide application-specific handling of the action.
 /// </summary>
 /// <param name="action">The action that has been triggered.</param>
 /// <param name="status">The status object.</param>
 protected override void OnSyncAction(SyncAction action, SyncStatus status)
 {
     if (action == this.StartAction)
     {
         try
         {
             OmStartCompany(status);
         }
         catch (Exception ex)
         {
             ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
             this.SnapIn.Console.ShowDialog(exForm);
         }
     }
     else if (action == this.StopAction)
     {
         try
         {
             OnStopCompany(status);
         }
         catch (Exception ex)
         {
             ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
             this.SnapIn.Console.ShowDialog(exForm);
         }
     }
     else if (action == this.ChangeDomainAction)
     {
         try
         {
             OnChangeDomain(status);
         }
         catch (Exception ex)
         {
             ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
             this.SnapIn.Console.ShowDialog(exForm);
         }
     }
     else if (action == this.UpgradeAction)
     {
         try
         {
             OnUpgrade(status);
         }
         catch (Exception ex)
         {
             ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
             this.SnapIn.Console.ShowDialog(exForm);
         }
     }
     else if (action == this.BrowseAction)
     {
         try
         {
             OnBrowse(status);
         }
         catch (Exception ex)
         {
             ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
             this.SnapIn.Console.ShowDialog(exForm);
         }
     }
     else if (action == EnableSchedulerServiceAction)
     {
         try
         {
             OnEnableSchedulerService(status);
         }
         catch (Exception ex)
         {
             ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
             this.SnapIn.Console.ShowDialog(exForm);
         }
     }
     else if (action == DisableSchedulerServiceAction)
     {
         try
         {
             OnDisableSchedulerService(status);
         }
         catch (Exception ex)
         {
             ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
             this.SnapIn.Console.ShowDialog(exForm);
         }
     }
     else if (action == ChangePortalPool)
     {
         try
         {
             OnChangePortalPool(status);
         }
         catch (Exception ex)
         {
             ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
             this.SnapIn.Console.ShowDialog(exForm);
         }
     }
 }
Ejemplo n.º 19
0
        /// <summary>
        /// Handles the execution of a selection-independent (view-global) action that runs synchronous to MMC.
        /// </summary>
        /// <param name="action">The executed action.</param>
        /// <param name="status">The object that holds the status information.</param>
        protected override void OnSyncAction(SyncAction action, SyncStatus status)
        {
            base.OnSyncAction(action, status);

            if (action == this.EditSqlServerSettingsAction)
            {
                try
                {
                    OnEditSqlServerSettingsAction(status);
                    this.ServerFeaturesControl.ReloadData();
                }
                catch (Exception ex)
                {
                    ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
                    this.SnapIn.Console.ShowDialog(exForm);
                }
            }
            else if (action == this.CreateAspAction)
            {
                try
                {
                    CreateAspSite(this.GetConfigurator(), this.SnapIn.Console, status);

                    this.ServerFeaturesControl.ReloadData();
                }
                catch (Exception ex)
                {
                    ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
                    this.SnapIn.Console.ShowDialog(exForm);
                }
            }
            else if (action == this.DeleteAspAction)
            {
                try
                {
                    OnDeleteAspAction(status);
                    this.ServerFeaturesControl.ReloadData();
                }
                catch (Exception ex)
                {
                    ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
                    this.SnapIn.Console.ShowDialog(exForm);
                }
            }
            else if (action == UpdateCommonComponentsAction)
            {
                try
                {
                    OnUpdateCommonComponentsAction(status);
                    this.ServerFeaturesControl.ReloadData();
                }
                catch (Exception ex)
                {
                    ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
                    this.SnapIn.Console.ShowDialog(exForm);
                }
            }
            else if (action == UpdateServerAction)
            {
                try
                {
                    OnUpdateServerAction(status);
                    this.ServerFeaturesControl.ReloadData();
                }
                catch (Exception ex)
                {
                    ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
                    this.SnapIn.Console.ShowDialog(exForm);
                }
            }
            else if (action == UpdateCheckAction)
            {
                try
                {
                    OnUpdateCheckAction(status);
                    this.ServerFeaturesControl.ReloadData();
                }
                catch (Exception ex)
                {
                    ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
                    this.SnapIn.Console.ShowDialog(exForm);
                }
            }
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Handles the execution of a selection-dependent action that runs synchronous to MMC.
        /// </summary>
        /// <param name="action">The executed action.</param>
        /// <param name="status">The object that holds the status information.</param>
        protected override void OnSyncSelectionAction(SyncAction action, SyncStatus status)
        {
            if (action == this.CopyToClipboardAction)
            {
                OnCopyToClipboard(status);
            }

            base.OnSyncAction(action, status);
        }
Ejemplo n.º 21
0
        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();*/
        }
Ejemplo n.º 22
0
 public SyncActionEventArgs(SyncAction action, SyncStatus status)
 {
     this._action = action;
     this._status = status;
 }
 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);
         }
     }
 }
Ejemplo n.º 24
0
        protected override void OnSyncSelectionAction(SyncAction action, SyncStatus status)
        {
            status.CanCancel = true;

            string newPortalPoolName = string.Empty;
            int versionId = 0;

            // Request Information
            if (action == this.ChangePortalPool)
            {
                EditPortalPoolForm form = new EditPortalPoolForm(GetConfigurator(), SnapInResources.CompanyScopeNode_Action_ChangePortalPool_Select);

                if (this.SnapIn.Console.ShowDialog(form) != DialogResult.OK ||
                    string.IsNullOrEmpty(form.PortalPool))
                    return;

                newPortalPoolName = form.PortalPool;

            }
            else if (action == this.UpgradeAction)
            {
                CompanyScopeNode[] upgradeCompanyItems = (CompanyScopeNode[])this.SelectionData.SelectionObject;

                UpdateCompanyListForm form = new UpdateCompanyListForm(GetConfigurator(), upgradeCompanyItems);

                if (DialogResult.Retry == this.SnapIn.Console.ShowDialog(form))
                {
                    Process currentProcess = Process.GetCurrentProcess();

                    // Start a new Process
                    ProcessStartInfo start = GetConfigurator().BuildUpdateCommandForCommonComponents(form.GetUpdateId(), currentProcess.Id);

                    // Run Update Common Components
                    Process.Start(start);

                    // Close current process
                    currentProcess.CloseMainWindow();
                }

                return;
            }

            // Read Selected nodes
            CompanyScopeNode[] companyItems = (CompanyScopeNode[])this.SelectionData.SelectionObject;

            int workProcessed = 0;
            int totalWork = companyItems.Length;

            // ReportProgress 0, Len
            status.ReportProgress(workProcessed, totalWork, string.Empty);

            foreach (CompanyScopeNode company in companyItems)
            {
                string companyId = (string)company.Tag;
                string companyName = company.DisplayName;

                if (action == this.StartAction)
                {
                    // ReportProgress Item, Len
                    status.ReportProgress(workProcessed, totalWork,
                        string.Format(SnapInResources.CompanyScopeNode_Action_Start_Progress, companyName));

                    OnStartCompany(companyId);

                    company.IsActive = true;
                }
                else if (action == this.StopAction)
                {
                    // ReportProgress Item, Len
                    status.ReportProgress(workProcessed, totalWork,
                        string.Format(SnapInResources.CompanyScopeNode_Action_Stop_Progress, companyName));

                    OnStopCompany(companyId);

                    company.IsActive = false;
                }
                else if (action == this.EnableSchedulerServiceAction)
                {
                    status.ReportProgress(workProcessed, totalWork,
                        string.Format(SnapInResources.CompanyScopeNode_Action_EnableSchedulerService_Progress, companyName));

                    OnEnableSchedulerService(companyId);

                    company.IsEnableShedulerService = true;
                }
                else if (action == this.DisableSchedulerServiceAction)
                {
                    status.ReportProgress(workProcessed, totalWork,
                        string.Format(SnapInResources.CompanyScopeNode_Action_DisableSchedulerService_Progress, companyName));

                    OnDisableSchedulerService(companyId);

                    company.IsEnableShedulerService = false;
                }
                else if (action == this.ChangePortalPool)
                {
                    status.ReportProgress(workProcessed, totalWork,
                        string.Format(SnapInResources.CompanyScopeNode_Action_ChangePortalPool_Progress, companyName));

                    company.SubItemDisplayNames[9] = OnChangePortalPool(companyId, newPortalPoolName);
                }
                else if (action == this.UpgradeAction)
                {
                    status.ReportProgress(workProcessed, totalWork,
                        string.Format(SnapInResources.CompanyScopeNode_Action_Upgrade_Progress, companyName));

                    OnUpgradeAction(companyId, versionId);
                }

                company.RefreshCompanyStatus();

                // Process Cancel
                if (status.IsCancelSignaled)
                    break;

                // Increase Progress
                workProcessed++;
            }

            // ReportProgress Len, Len
            status.ReportProgress(totalWork, totalWork, string.Empty);

            // Refresh Selection Button
            OnSelectionChanged(null);
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Allows snap-in code to perform custom view initialization.
        /// </summary>
        /// <param name="status">The status object to update.</param>
        protected override void OnInitialize(AsyncStatus status)
        {
            base.OnInitialize(status);

            // Create a set of columns for use in the list view
            // Define the default column title
            this.Columns[0].Title = SnapInResources.CompanyListView_Column_Name;
            this.Columns[0].SetWidth(200);

            // Add detail column
            //this.Columns.Add(new MmcListViewColumn(SnapInResources.CompanyListView_Column_Created, 100));
            this.Columns.Add(new MmcListViewColumn(SnapInResources.CompanyListView_Column_Status, 75));
            this.Columns.Add(new MmcListViewColumn(SnapInResources.CompanyListView_Column_Ssl, 50));
            this.Columns.Add(new MmcListViewColumn(SnapInResources.CompanyListView_Column_PrimaryDomain, 150));
            this.Columns.Add(new MmcListViewColumn(SnapInResources.CompanyListView_Column_Port, 50));
            this.Columns.Add(new MmcListViewColumn(SnapInResources.CompanyListView_Column_Build, 50));

            this.Columns.Add(new MmcListViewColumn(SnapInResources.CompanyListView_Column_DatabaseName, 150));
            //this.Columns.Add(new MmcListViewColumn(SnapInResources.CompanyListView_Column_DatabaseVersion, 50));

            this.Columns.Add(new MmcListViewColumn(SnapInResources.CompanyListView_Column_CodePath, 150));
            this.Columns.Add(new MmcListViewColumn(SnapInResources.CompanyListView_Column_SiteId, 100));
            this.Columns.Add(new MmcListViewColumn(SnapInResources.CompanyListView_Column_IMPool, 150));
            this.Columns.Add(new MmcListViewColumn(SnapInResources.CompanyListView_Column_PortalPool, 150));

            this.Columns.Add(new MmcListViewColumn(SnapInResources.CompanyListView_Column_SchedulerServiceStatus, 75));

            this.Columns.Add(new MmcListViewColumn(SnapInResources.CompanyListView_Column_DefaultLanguage, 75));

            // Set to show all columns
            this.Mode = MmcListViewMode.Report;  // default (set for clarity)

            // Set to show refresh as an option
            //this.SelectionData.EnabledStandardVerbs = StandardVerbs.Refresh;

            // Multi Company Actions
            this.StartAction = new SyncAction(SnapInResources.CompanyScopeNode_Action_Start_Name,
                SnapInResources.CompanyScopeNode_Action_Start_Description, 10);
            this.StopAction = new SyncAction(SnapInResources.CompanyScopeNode_Action_Stop_Name,
                SnapInResources.CompanyScopeNode_Action_Stop_Description, 11);
            this.UpgradeAction = new SyncAction(SnapInResources.CompanyScopeNode_Action_Upgrade_Name,
                            SnapInResources.CompanyScopeNode_Action_Upgrade_Description, 6);

            this.EnableSchedulerServiceAction = new SyncAction(SnapInResources.CompanyScopeNode_Action_EnableSchedulerService_Name,
                SnapInResources.CompanyScopeNode_Action_EnableSchedulerService_Description, 27);
            this.DisableSchedulerServiceAction = new SyncAction(SnapInResources.CompanyScopeNode_Action_DisableSchedulerService_Name,
                SnapInResources.CompanyScopeNode_Action_DisableSchedulerService_Description, 28);

            this.ChangePortalPool = new SyncAction(SnapInResources.CompanyScopeNode_Action_ChangePortalPool_Name,
                SnapInResources.CompanyScopeNode_Action_ChangePortalPool_Description, 29);
        }
Ejemplo n.º 26
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);
            }
        }
Ejemplo n.º 27
0
 protected void RenderStoreGroups()
 {
     //Prepare Node
     this.DisplayName = Globalization.MultilanguageResource.GetString("Folder_Msg90");
     this.SubItemDisplayNames.Clear();
     this.SubItemDisplayNames.Add(Globalization.MultilanguageResource.GetString("Folder_Tit90"));
     this.ImageIndex = ImageIndexes.StoreGroupsImgIdx;
     this.SelectedImageIndex = ImageIndexes.StoreGroupsImgIdx;
     //Assign Tag
     this.Tag = store;
     //Enable standard verbs
     this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
     //Add custom actions
     this.ActionsPaneItems.Clear();
     //New Store Group - MMC.SyncAction
     MMC.SyncAction newStoreGroupAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg440"), Globalization.MultilanguageResource.GetString("Menu_Tit440"));
     if (!this.store.IAmManager)
         newStoreGroupAction.Enabled = false;
     newStoreGroupAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(newStoreGroupAction_Triggered);
     this.ActionsPaneItems.Add(newStoreGroupAction);
     //Line MMC.SyncAction
     MMC.ActionSeparator lineAction1 = new MMC.ActionSeparator();
     this.ActionsPaneItems.Add(lineAction1);
     //Import - MMC.SyncAction
     MMC.SyncAction importAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg450"), Globalization.MultilanguageResource.GetString("Menu_Msg460"));
     if (!this.store.IAmManager)
         importAction.Enabled = false;
     importAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(importAction_Triggered);
     this.ActionsPaneItems.Add(importAction);
 }
Ejemplo n.º 28
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);
 }
Ejemplo n.º 29
0
        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 RenderApplicationGroups()
 {
     //Prepare Node
     this.DisplayName = Globalization.MultilanguageResource.GetString("ListView_Msg20");
     this.SubItemDisplayNames.Clear();
     this.SubItemDisplayNames.Add(Globalization.MultilanguageResource.GetString("Folder_Msg10"));
     this.ImageIndex = ImageIndexes.ApplicationGroupsImgIdx;
     this.SelectedImageIndex = ImageIndexes.ApplicationGroupsImgIdx;
     //Assign Tag
     this.Tag = application;
     //Enable standard verbs
     this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
     //Add custom actions
     this.ActionsPaneItems.Clear();
     //New Application Group - MMC.SyncAction
     MMC.SyncAction newApplicationGroupAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg210"), Globalization.MultilanguageResource.GetString("Menu_Tit210"));
     if (!this.application.IAmManager)
         newApplicationGroupAction.Enabled = false;
     newApplicationGroupAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(newApplicationGroupAction_Triggered);
     this.ActionsPaneItems.Add(newApplicationGroupAction);
     //Line MMC.SyncAction
     MMC.ActionSeparator lineAction1 = new MMC.ActionSeparator();
     this.ActionsPaneItems.Add(lineAction1);
     //Import - MMC.SyncAction
     MMC.SyncAction importAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg220"), Globalization.MultilanguageResource.GetString("Menu_Tit220"));
     if (!this.application.IAmManager)
         importAction.Enabled = false;
     importAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(importAction_Triggered);
     this.ActionsPaneItems.Add(importAction);
      /*System.Windows.Forms.Application.DoEvents();*/
 }
Ejemplo n.º 31
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);
        }
        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);
            }
        }
Ejemplo n.º 33
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 RenderOperationDefinitions()
 {
     //Prepare Node
     this.DisplayName = Globalization.MultilanguageResource.GetString("Folder_Msg50");
     this.SubItemDisplayNames.Clear();
     this.SubItemDisplayNames.Add(Globalization.MultilanguageResource.GetString("Folder_Tit50"));
     this.ImageIndex = ImageIndexes.ItemsImgIdx;
     this.SelectedImageIndex = ImageIndexes.ItemsImgIdx;
     //Assign Tag
     this.Tag = application;
     //Enable standard verbs
     this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
     //Add custom actions
     this.ActionsPaneItems.Clear();
     //New Item - MMC.SyncAction
     MMC.SyncAction newOperationAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg320"), Globalization.MultilanguageResource.GetString("Menu_Tit320"));
     if (!this.application.IAmManager)
         newOperationAction.Enabled = false;
     newOperationAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(newOperationDefinitionAction_Triggered);
     this.ActionsPaneItems.Add(newOperationAction);
 }
Ejemplo n.º 35
0
        /// <summary>
        /// Called when an action is triggered for the node. Derived classes should override this method to provide application-specific handling of the action.
        /// </summary>
        /// <param name="action">The action that has been triggered.</param>
        /// <param name="status">The status object.</param>
        protected override void OnSyncAction(SyncAction action, SyncStatus status)
        {
            if (action == this.CreateNewCompany)
            {
                try
                {
                    OnCreateNewCompany(status);
                }
                catch (LicenseExpiredException)
                {
                    MessageBoxParameters msgBox = new MessageBoxParameters();
                    msgBox.Icon = MessageBoxIcon.Error;
                    msgBox.Caption = SnapInResources.License_Expired;
                    msgBox.Text = string.Format(SnapInResources.License_Expired_Text, Mediachase.Ibn.IbnConst.FullProductName);
                    msgBox.Buttons = MessageBoxButtons.OK;

                    this.SnapIn.Console.ShowDialog(msgBox);
                }
                catch (Exception ex)
                {
                    ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
                    this.SnapIn.Console.ShowDialog(exForm);
                }
            }
            else if (action == this.CreateNewCompanyForDatabase)
            {
                try
                {
                    OnCreateNewCompanyForDatabase(status);
                }
                catch (LicenseExpiredException)
                {
                    MessageBoxParameters msgBox = new MessageBoxParameters();
                    msgBox.Icon = MessageBoxIcon.Error;
                    msgBox.Caption = SnapInResources.License_Expired;
                    msgBox.Text = string.Format(SnapInResources.License_Expired_Text, Mediachase.Ibn.IbnConst.FullProductName);
                    msgBox.Buttons = MessageBoxButtons.OK;

                    this.SnapIn.Console.ShowDialog(msgBox);
                }
                catch (Exception ex)
                {
                    ThreadExceptionDialog exForm = new ThreadExceptionDialog(ex);
                    this.SnapIn.Console.ShowDialog(exForm);
                }
            }
        }
Ejemplo n.º 36
0
 protected virtual void OnSyncAction(SyncAction action, SyncStatus status)
 {
 }
 protected void RenderItemDefinitions()
 {
     //Prepare Node
     this.DisplayName = Globalization.MultilanguageResource.GetString("Folder_Msg30");
     this.SubItemDisplayNames.Clear();
     this.SubItemDisplayNames.Add(Globalization.MultilanguageResource.GetString("Folder_Tit30"));
     this.ImageIndex = ImageIndexes.ItemsImgIdx;
     this.SelectedImageIndex = ImageIndexes.ItemsImgIdx;
     //Assign Tag
     this.Tag = application;
     //Enable standard verbs
     this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
     //Add custom actions
     this.ActionsPaneItems.Clear();
     //Line MMC.SyncAction
     MMC.ActionSeparator lineAction1 = new MMC.ActionSeparator();
     this.ActionsPaneItems.Add(lineAction1);
     //Import - MMC.SyncAction
     MMC.SyncAction importAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg300"), Globalization.MultilanguageResource.GetString("Menu_Tit300"));
     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_Msg310"), Globalization.MultilanguageResource.GetString("Menu_Tit310"));
     exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
     this.ActionsPaneItems.Add(exportAction);
 }
        /// <summary>
        /// Handle triggered action
        /// </summary>
        /// <param name="action">triggered action</param>
        /// <param name="status">synchronous status to update console</param>
        protected override void OnSyncAction(SyncAction action, SyncStatus status)
        {
            switch ((string)action.Tag)
            {
                case "ConnectTo":
                    {
                        ConnectDialog connectDialog = new ConnectDialog();
                        connectDialog.ConnectToServerName.Text = String.Empty;

                        if (this.SnapIn.Console.ShowDialog(connectDialog) == DialogResult.OK)
                        {
                            this.DisplayName = "Connected (" + connectDialog.ConnectToServerName.Text + ")";
                        }
                        break;
                    }
                case "CommonDialog":
                    {
                        ColorDialog colorDialog = new ColorDialog();
                        colorDialog.AllowFullOpen = false;

                        if (this.SnapIn.Console.ShowDialog(colorDialog) == DialogResult.OK)
                        {
                            this.DisplayName = "CommonDialog - Selected a Color";
                        }
                        break;
                    }
                case "MessageBox":
                    {
                        MessageBoxParameters messageBoxParameters = new MessageBoxParameters();

                        messageBoxParameters.Caption = "Sample MessageBox...";
                        messageBoxParameters.Buttons = MessageBoxButtons.OKCancel;
                        messageBoxParameters.Text = "Select Ok or Cancel";

                        if (this.SnapIn.Console.ShowDialog(messageBoxParameters) == DialogResult.OK)
                        {
                            this.DisplayName = "MessageBox - Selected Ok";
                        }
                        break;
                    }
                case "UserDefinedForm":
                    {
                        UserDefinedForm userDefinedForm = new UserDefinedForm();

                        if (this.SnapIn.Console.ShowDialog(userDefinedForm) == DialogResult.OK)
                        {
                            this.DisplayName = "User Defined Form - Ok";
                        }
                        break;
                    }
                case "UserDefinedFormWithWaitCursor":
                    {
                        WaitCursor waitCursor = new WaitCursor();
                        waitCursor.Timeout = new System.TimeSpan(0,0,5);

                        UserDefinedFormForWaiting userDefinedFormForWaiting = new UserDefinedFormForWaiting();

                        if (this.SnapIn.Console.ShowDialog(userDefinedFormForWaiting, waitCursor) == DialogResult.OK)
                        {
                            this.DisplayName = "User Defined Form with Wait Cursor - Ok";
                        }
                        break;
                    }
            }
        }
 protected void RenderItemDefinitionScopeNode()
 {
     //Prepare Node
     this.DisplayName = item.Name;
     this.SubItemDisplayNames.Clear();
     this.SubItemDisplayNames.AddRange(
         new string[] {
                         item.Description,
                         item.ItemId.ToString()});
     switch (this.item.ItemType)
     {
         case ItemType.Role:
             this.ImageIndex = this.SelectedImageIndex = ImageIndexes.RoleImgIdx;
             break;
         case ItemType.Task:
             this.ImageIndex = this.SelectedImageIndex = ImageIndexes.TaskImgIdx;
             break;
         case ItemType.Operation:
             this.ImageIndex = this.SelectedImageIndex = ImageIndexes.OperationImgIdx;
             break;
     }
     //Assign Tag
     this.Tag = item;
     //Enable standard verbs
     if (this.item.Application.IAmManager)
         this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh | MMC.StandardVerbs.Delete;
     else
         this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
     //Add custom actions
     this.ActionsPaneItems.Clear();
     //Item Properties - MMC.SyncAction
     string itemTypeName = String.Empty;
     MMC.SyncAction itemDefinitionPropertiesAction = null;
     switch (this.item.ItemType)
     {
         case ItemType.Role:
             itemDefinitionPropertiesAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("ListView_Msg60"), Globalization.MultilanguageResource.GetString("ListView_Tit60"));
             break;
         case ItemType.Task:
             itemDefinitionPropertiesAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("ListView_Msg70"), Globalization.MultilanguageResource.GetString("ListView_Tit70"));
             break;
         case ItemType.Operation:
             itemDefinitionPropertiesAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("ListView_Msg80"), Globalization.MultilanguageResource.GetString("ListView_Tit80"));
             break;
     }
     itemDefinitionPropertiesAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(itemDefinitionPropertiesAction_Triggered);
     this.ActionsPaneItems.Add(itemDefinitionPropertiesAction);
 }
 protected void RenderApplicationGroupScopeNode()
 {
     this.DisplayName = this.applicationGroup.Name;
     this.SubItemDisplayNames.Clear();
     this.SubItemDisplayNames.AddRange(
         new string[] {
                         this.applicationGroup.Description,
                         this.applicationGroup.GroupType.ToString(),
                         this.applicationGroup.SID.StringValue});
     this.ImageIndex = this.applicationGroup.GroupType == GroupType.Basic ? ImageIndexes.ApplicationGroupBasicImgIdx : ImageIndexes.ApplicationGroupLDAPImgIdx;
     this.SelectedImageIndex = this.ImageIndex;
     //Assign Tag
     this.Tag = this.applicationGroup;
     //Enable standard verbs
     if (this.applicationGroup.Application.IAmManager)
         this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh | MMC.StandardVerbs.Delete;
     else
         this.EnabledStandardVerbs = MMC.StandardVerbs.Refresh;
     //Add custom actions
     //MMC.SyncAction - Application Group Properties
     this.ActionsPaneItems.Clear();
     MMC.SyncAction applicationGroupPropertiesAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg160"), Globalization.MultilanguageResource.GetString("Menu_Tit160"));
     applicationGroupPropertiesAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(applicationGroupPropertiesAction_Triggered);
     this.ActionsPaneItems.Add(applicationGroupPropertiesAction);
     //Line MMC.SyncAction
     MMC.ActionSeparator lineAction1 = new MMC.ActionSeparator();
     this.ActionsPaneItems.Add(lineAction1);
     //Line MMC.SyncAction
     MMC.ActionSeparator lineAction2 = new MMC.ActionSeparator();
     this.ActionsPaneItems.Add(lineAction2);
     //Export - MMC.SyncAction
     MMC.SyncAction exportAction = new MMC.SyncAction(Globalization.MultilanguageResource.GetString("Menu_Msg170"), Globalization.MultilanguageResource.GetString("Menu_Tit170"));
     exportAction.Triggered += new MMC.SyncAction.SyncActionEventHandler(exportAction_Triggered);
     this.ActionsPaneItems.Add(exportAction);
     /*System.Windows.Forms.Application.DoEvents();*/
 }