void checkAccessTestAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmCheckAccessTest frm = new frmCheckAccessTest(); frm.application = this.application; this.SnapIn.Console.ShowDialog(frm); }
void auditingAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmSQLAudit frm = new frmSQLAudit(); frm.storage = this.storage; this.SnapIn.Console.ShowDialog(frm); }
void ItemsHVAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmItemsHierarchyView frm = new frmItemsHierarchyView(); frm.applications = new IAzManApplication[] { this.application }; this.SnapIn.Console.ShowDialog(frm); }
void deleteApplicationGroupsAction_Triggered(object sender, MMC.SyncActionEventArgs e) { MessageBoxParameters mbp = new MessageBoxParameters(); mbp.Buttons = MessageBoxButtons.YesNo; mbp.Caption = e.Action.DisplayName; mbp.DefaultButton = MessageBoxDefaultButton.Button2; mbp.Icon = MessageBoxIcon.Question; mbp.Text = String.Format(Globalization.MultilanguageResource.GetString("ApplicationGroupsListView_Msg10")); DialogResult dr = this.SnapIn.Console.ShowDialog(mbp); if (dr == DialogResult.Yes) { try { foreach (ApplicationGroupScopeNode applicationGroupScopeNode in this.SelectedNodes) { applicationGroupScopeNode.ApplicationGroup.Delete(); this.ScopeNode.Children.Remove(applicationGroupScopeNode); } } catch (Exception ex) { this.ShowError(ex.Message, Globalization.MultilanguageResource.GetString("ApplicationGroupsListView_Msg20")); } } }
private void storeGroupPropertiesAction_Triggered(object sender, MMC.SyncActionEventArgs e) { try { frmStoreGroupsProperties frm = new frmStoreGroupsProperties(); frm.Text += " - " + this.storeGroup.Name; frm.storeGroup = this.storeGroup; DialogResult dr = this.SnapIn.Console.ShowDialog(frm); /*Application.DoEvents();*/ frm.Dispose(); /*Application.DoEvents();*/ if (dr == DialogResult.OK) { this.Render(); try { this.NotifyChanged(); /*Application.DoEvents();*/ } catch { } } } catch (Exception ex) { this.ShowError(ex.Message, Globalization.MultilanguageResource.GetString("StoreGroupScopeNode_Msg10")); } }
void permissionAction_Triggered(object sender, MMC.SyncActionEventArgs e, AuthorizationType authorizationType) { try { foreach (MMC.ResultNode resultNode in this.SelectedNodes) { IAzManAuthorization auth = (IAzManAuthorization)resultNode.Tag; this.changePermission(auth, authorizationType); string sAuthType; switch (authorizationType) { default: case AuthorizationType.Neutral: sAuthType = Globalization.MultilanguageResource.GetString("Domain_Neutral"); break; case AuthorizationType.Allow: sAuthType = Globalization.MultilanguageResource.GetString("Domain_Allow"); break; case AuthorizationType.AllowWithDelegation: sAuthType = Globalization.MultilanguageResource.GetString("Domain_AllowWithDelegation"); break; case AuthorizationType.Deny: sAuthType = Globalization.MultilanguageResource.GetString("Domain_Deny"); break; } resultNode.SubItemDisplayNames[0] = sAuthType; } } catch (Exception ex) { this.ShowError(ex.Message, Globalization.MultilanguageResource.GetString("AuthorizationsListView_Tit10")); } finally { /*Application.DoEvents();*/ } }
void modeAndLoggingAction_Triggered(object sender, MMC.SyncActionEventArgs e) { try { frmOptions frm = new frmOptions(); frm.storage = this.storage; frm.mode = this.storage.Mode; frm.logOnEventLog = this.storage.LogOnEventLog; frm.logOnDb = this.storage.LogOnDb; frm.logErrors = this.storage.LogErrors; frm.logWarnings = this.storage.LogWarnings; frm.logInformations = this.storage.LogInformations; DialogResult dr = this.SnapIn.Console.ShowDialog(frm); if (dr == DialogResult.OK) { this.storage.Mode = frm.mode; this.storage.LogOnEventLog = frm.logOnEventLog; this.storage.LogOnDb = frm.logOnDb; this.storage.LogErrors = frm.logErrors; this.storage.LogWarnings = frm.logWarnings; this.storage.LogInformations = frm.logInformations; this.storage = new SqlAzManStorage(frmStorageConnection.ConstructConnectionString(this.dataSource, this.initialCatalog, !(this.security == "Sql"), this.userId, this.password, this.otherSettings)); this.SnapIn.IsModified = true; this.Render(); } } catch (Exception ex) { this.ShowError(ex.Message + "\r\n" + Globalization.MultilanguageResource.GetString("StorageScopeNode_Msg30"), Globalization.MultilanguageResource.GetString("StorageScopeNode_Tit30")); } }
void deleteAuthorizationsAction_Triggered(object sender, MMC.SyncActionEventArgs e) { MessageBoxParameters mbp = new MessageBoxParameters(); mbp.Buttons = MessageBoxButtons.YesNo; mbp.Caption = e.Action.DisplayName; mbp.DefaultButton = MessageBoxDefaultButton.Button2; mbp.Icon = MessageBoxIcon.Question; mbp.Text = String.Format(Globalization.MultilanguageResource.GetString("Menu_Msg50")); DialogResult dr = this.SnapIn.Console.ShowDialog(mbp); if (dr == DialogResult.Yes) { try { foreach (MMC.ResultNode resultNode in this.SelectedNodes) { IAzManAuthorization auth = (IAzManAuthorization)resultNode.Tag; auth.Delete(); this.ResultNodes.Remove(resultNode); } } catch (Exception ex) { this.ShowError(ex.Message, Globalization.MultilanguageResource.GetString("AuthorizationsListView_Tit20")); } } }
void gcahAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmGenerateCheckAccessHelper frm = new frmGenerateCheckAccessHelper(); frm.application = this.application; this.SnapIn.Console.ShowDialog(frm); }
void EffectivePermissionsReportAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmPrint frm = new frmPrint(); ptEffectivePermissions rep = new ptEffectivePermissions(); rep.Applications = new IAzManApplication[] { this.application }; frm.document = rep; this.SnapIn.Console.ShowDialog(frm); }
void ItemsHReportAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmPrint frm = new frmPrint(); ptItemsHierarchy rep = new ptItemsHierarchy(); rep.Applications = new IAzManApplication[] { this.application }; frm.document = rep; this.SnapIn.Console.ShowDialog(frm); }
void AuthorizationsReportAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmPrint frm = new frmPrint(); ptItemAuthorizations rep = new ptItemAuthorizations(); rep.Applications = this.store.GetApplications(); frm.document = rep; this.SnapIn.Console.ShowDialog(frm); }
void LanguageEnglishAction_Triggered(object sender, MMC.SyncActionEventArgs e) { if (this.selectedLanguage != "English") { this.selectedLanguage = "English"; Globalization.MultilanguageResource.SetCulture(this.selectedLanguage); this.Render(); this.SnapIn.IsModified = true; } }
void exportAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmExportOptions frm = new frmExportOptions(); DialogResult dr = this.SnapIn.Console.ShowDialog(frm); if (dr == DialogResult.OK) { frmExport frmwait = new frmExport(); frmwait.ShowDialog(e, frm.fileName, this.storage.GetStores(), frm.includeSecurityObjects, frm.includeDBUsers, frm.includeAuthorizations, this.storage); } }
private void newStoreAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmStoreProperties frm = new frmStoreProperties(); frm.storage = this.storage; DialogResult dr = this.SnapIn.Console.ShowDialog(frm); if (dr == DialogResult.OK) { this.Children.Add(new StoreScopeNode(frm.store)); } }
private void newStoreGroupAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmNewStoreGroup frm = new frmNewStoreGroup(); frm.store = this.store; DialogResult dr = this.SnapIn.Console.ShowDialog(frm); if (dr == DialogResult.OK) { this.Children.Add(new StoreGroupScopeNode(frm.storeGroup)); } }
void deleteItemDefinitionsAction_Triggered(object sender, MMC.SyncActionEventArgs e) { MessageBoxParameters mbp = new MessageBoxParameters(); mbp.Buttons = MessageBoxButtons.YesNo; mbp.Caption = e.Action.DisplayName; mbp.DefaultButton = MessageBoxDefaultButton.Button2; mbp.Icon = MessageBoxIcon.Question; mbp.Text = Globalization.MultilanguageResource.GetString("ItemDefinitionsListView_Msg10"); DialogResult dr = this.SnapIn.Console.ShowDialog(mbp); if (dr == DialogResult.Yes) { try { foreach (ItemDefinitionScopeNode itemDefinitionScopeNode in this.SelectedNodes) { itemDefinitionScopeNode.Item.Delete(); //Remove relative child in Item Authorizations MMC.ScopeNode itemDefinitionsScopeNode = itemDefinitionScopeNode.Parent; while (itemDefinitionsScopeNode as ItemDefinitionsScopeNode == null) { itemDefinitionsScopeNode = itemDefinitionsScopeNode.Parent; //go up one level } ItemAuthorizationsScopeNode itemAuthorizationsScopeNode = (ItemAuthorizationsScopeNode)itemDefinitionsScopeNode.Parent.Children[2]; foreach (MMC.ScopeNode itemAuthorizationsScopeNodeChild in itemAuthorizationsScopeNode.Children) { bool founded = false; foreach (ItemAuthorizationScopeNode itemAuthorizationScopeNode in itemAuthorizationsScopeNodeChild.Children) { if (itemDefinitionScopeNode.Item.Name == itemAuthorizationScopeNode.Item.Name) { itemAuthorizationScopeNode.Parent.Children.Remove(itemAuthorizationScopeNode); founded = true; break; } } if (founded) { break; } } this.ScopeNode.Children.Remove(itemDefinitionScopeNode); } } catch (Exception ex) { this.ShowError(ex.Message, Globalization.MultilanguageResource.GetString("ItemDefinitionsListView_Tit20")); } } }
void ItemsHVAction_Triggered(object sender, MMC.SyncActionEventArgs e) { IAzManApplication[] applications = new IAzManApplication[this.SelectedNodes.Count]; int index = 0; foreach (ApplicationScopeNode applicationScopeNode in this.SelectedNodes) { applications[index++] = applicationScopeNode.Application; } frmItemsHierarchyView frm = new frmItemsHierarchyView(); frm.applications = applications; this.SnapIn.Console.ShowDialog(frm); }
private void storePropertiesAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmStoreProperties frm = new frmStoreProperties(); frm.Text += " - " + this.store.Name; frm.store = this.store; frm.storage = this.store.Storage; DialogResult dr = this.SnapIn.Console.ShowDialog(frm); if (dr == DialogResult.OK) { this.RenderStoreScopeNode(); } }
private void applicationPropertiesAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmApplicationProperties frm = new frmApplicationProperties(); frm.Text += " - " + this.application.Name; frm.application = this.application; frm.store = this.application.Store; DialogResult dr = this.SnapIn.Console.ShowDialog(frm); if (dr == DialogResult.OK) { this.RenderApplication(); } }
void EffectivePermissionsReportAction_Triggered(object sender, MMC.SyncActionEventArgs e) { IAzManApplication[] applications = new IAzManApplication[this.SelectedNodes.Count]; int index = 0; foreach (ApplicationScopeNode applicationScopeNode in this.SelectedNodes) { applications[index++] = applicationScopeNode.Application; } frmPrint frm = new frmPrint(); ptEffectivePermissions rep = new ptEffectivePermissions(); rep.Applications = applications; frm.document = rep; this.SnapIn.Console.ShowDialog(frm); }
void exportAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmExportOptions frm = new frmExportOptions(); DialogResult dr = this.SnapIn.Console.ShowDialog(frm); if (dr == DialogResult.OK) { frmExport frmwait = new frmExport(); IAzManExport[] objectsToExport = new IAzManExport[this.SelectedNodes.Count]; for (int i = 0; i < this.SelectedNodes.Count; i++) { objectsToExport[i] = ((ItemDefinitionScopeNode)this.SelectedNodes[i]).Item; } frmwait.ShowDialog(e, frm.fileName, objectsToExport, frm.includeSecurityObjects, frm.includeDBUsers, frm.includeAuthorizations, ((ItemDefinitionScopeNode)this.SelectedNodes[0]).Item.Application.Store.Storage); } }
void importAzManAction_Triggered(object sender, MMC.SyncActionEventArgs e) { try { frmImportFromAzMan frm = new frmImportFromAzMan(); frm.storage = this.storage; DialogResult dr = this.SnapIn.Console.ShowDialog(frm); if (dr == DialogResult.OK) { this.Render(); } } catch (Exception ex) { this.ShowError(ex.Message, Globalization.MultilanguageResource.GetString("StorageScopeNode_Msg10")); } }
void exportAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmExportOptions frm = new frmExportOptions(); DialogResult dr = this.SnapIn.Console.ShowDialog(frm); if (dr == DialogResult.OK) { frmExport frmwait = new frmExport(); IAzManItem[] itemToExport = this.application.GetItems(); IAzManExport[] toExport = new IAzManExport[itemToExport.Length]; for (int i = 0; i < itemToExport.Length; i++) { toExport[i] = itemToExport[i]; } frmwait.ShowDialog(e, frm.fileName, toExport, frm.includeSecurityObjects, frm.includeDBUsers, frm.includeAuthorizations, this.application.Store.Storage); } }
public DialogResult ShowDialog(MMC.SyncActionEventArgs e, string fileName, IAzManExport[] objectsToExport, bool includeSecurityObjects, bool includeDBUsers, bool includeAuthorizations, IAzManStorage storage) { this.storage = storage; XmlWriter xw = null; try { this.Show(); this.Activate(); this.Focus(); /*Application.DoEvents();*/ if (e != null) { e.Status.ReportProgress(50, 100, Globalization.MultilanguageResource.GetString("frmExport_Msg10")); } xw = XmlWriter.Create(fileName); this.BeginExport(xw); foreach (IAzManExport objectToExport in objectsToExport) { objectToExport.Export(xw, includeSecurityObjects, includeDBUsers, includeAuthorizations, objectToExport); /*Application.DoEvents();*/ } this.EndExport(xw); if (e != null) { e.Status.Complete(Globalization.MultilanguageResource.GetString("frmExport_Msg20"), true); } return(this.DialogResult = DialogResult.OK); } catch (Exception ex) { this.ShowError(ex.Message, Globalization.MultilanguageResource.GetString("frmExport_Msg30")); e.Status.Complete(Globalization.MultilanguageResource.GetString("frmExport_Msg20"), false); return(this.DialogResult = DialogResult.Cancel); } finally { if (xw != null) { xw.Flush(); xw.Close(); } this.Hide(); } }
void importAction_Triggered(object sender, MMC.SyncActionEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.DefaultExt = "xml"; openFileDialog.FileName = "NetSqlAzMan.xml"; openFileDialog.Filter = "Xml files|*.xml|All files|*.*"; openFileDialog.SupportMultiDottedExtensions = true; openFileDialog.Title = Globalization.MultilanguageResource.GetString("ApplicationGroupsScopeNode_Msg10"); DialogResult dr = this.SnapIn.Console.ShowDialog(openFileDialog); if (dr == DialogResult.OK) { frmImportOptions frm = new frmImportOptions(); frm.importIntoObject = this.storage; frm.fileName = openFileDialog.FileName; this.SnapIn.Console.ShowDialog(frm); this.Render(); } }
void newOperationDefinitionAction_Triggered(object sender, MMC.SyncActionEventArgs e) { MMC.ScopeNode itemNode = (MMC.ScopeNode)sender; frmItemProperties frm = new frmItemProperties(); frm.application = this.application; frm.item = null; frm.itemType = ItemType.Operation; DialogResult dr = this.SnapIn.Console.ShowDialog(frm); if (dr == DialogResult.OK) { this.Children.Add(new ItemDefinitionScopeNode(frm.item)); //Add relative child in Item Authorizations if opened try { if ( this.Parent != null && this.Parent.Parent != null && this.Parent.Parent.Children.Count >= 3 && this.Parent.Parent.Children[2].Children.Count >= 3 ) { MMC.ScopeNode itemDefinitionsScopeNode = this.Parent; OperationAuthorizationsScopeNode itemAuthorizationsScopeNode = (itemDefinitionsScopeNode.Parent.Children[2].Children[2]) as OperationAuthorizationsScopeNode; if (itemAuthorizationsScopeNode != null) { itemAuthorizationsScopeNode.Children.Add(new ItemAuthorizationScopeNode(frm.item)); } } } catch { } /*System.Windows.Forms.Application.DoEvents();*/ } }
void manageAuthorizationsAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmItemAuthorizations frm = new frmItemAuthorizations(); frm.Text += " - " + this.item.Name; frm.item = this.item; DialogResult dr = this.SnapIn.Console.ShowDialog(frm); /*Application.DoEvents();*/ frm.Dispose(); /*Application.DoEvents();*/ if (dr == DialogResult.OK) { this.Render(); try { this.NotifyChanged(); /*Application.DoEvents();*/ } catch { } } }
private void invalidateWCFCacheServiceAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmInvalidateWCFCacheService frm = new frmInvalidateWCFCacheService(); this.SnapIn.Console.ShowDialog(frm); }
protected internal void sqlStoreConnectionStringAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmStorageConnection frm = new frmStorageConnection(); frm.dataSource = this.dataSource; frm.initialCatalog = this.initialCatalog; frm.security = this.security; frm.otherSettings = this.otherSettings; frm.userId = this.userId; frm.password = this.password; DialogResult dr = this.SnapIn.Console.ShowDialog(frm); if (dr == DialogResult.OK) { this.dataSource = frm.dataSource; this.initialCatalog = frm.initialCatalog; this.security = frm.security; this.otherSettings = frm.otherSettings; this.userId = frm.userId; this.password = frm.password; this.storage = new SqlAzManStorage(frmStorageConnection.ConstructConnectionString(this.dataSource, this.initialCatalog, !(this.security == "Sql"), this.userId, this.password, this.otherSettings)); this.Render(); ((NetSqlAzManSnapIn)this.SnapIn).dataSource = this.dataSource; ((NetSqlAzManSnapIn)this.SnapIn).initialCatalog = this.initialCatalog; ((NetSqlAzManSnapIn)this.SnapIn).security = this.security; ((NetSqlAzManSnapIn)this.SnapIn).otherSettings = this.otherSettings; ((NetSqlAzManSnapIn)this.SnapIn).userId = this.userId; ((NetSqlAzManSnapIn)this.SnapIn).password = this.password; this.SnapIn.IsModified = true; } }