protected override void OnInitialize(AsyncStatus status) { // This is a default column which already exists when the control is created. NameColumn = Columns[0]; NameColumn.Title = "Name"; NameColumn.SetWidth(150); TaskIdColumn = new MmcListViewColumn("Task ID", -1); StartColumn = new MmcListViewColumn("Start Time", -1); EndColumn = new MmcListViewColumn("End Time", -1); DurationColumn = new MmcListViewColumn("Duration", -1); CompletedColumn = new MmcListViewColumn("Completed", -1); Columns.AddRange(new MmcListViewColumn[] { TaskIdColumn, StartColumn, EndColumn, DurationColumn, CompletedColumn }); Refresh(); MMC.Action RefreshAction = new MMC.Action("Refresh", "Refresh the Task List", SnapInShared.Refresh, "Refresh"); ActionsPaneItems.Add(RefreshAction); Mode = MmcListViewMode.Report; InitializeWatchers(); base.OnInitialize(status); }
protected override void OnSelectionAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { switch ((int)action.Tag) { case ACTION_SHOW_REQUEST: ShowSigningRequest(); break; case ACTION_EXPORT_REQUEST: ExportSigningRequest(); break; } }
protected override void OnSelectionAction(Action action, AsyncStatus status) { switch ((int)action.Tag) { case ActionShowCertificate: ShowCertificateDetails(); break; case ActionRemoveSslCertificate: RemoveCertificate(); break; } }
protected override void OnSelectionAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { switch ((int)action.Tag) { case ACTION_SHOW_PROPERTIES: ShowProperties(); break; } }
/// <summary> /// Constructor implementation /// </summary> public UsersScopeNode() : base(true) { this.DisplayName = "Gestion des utilisateurs"; this.LanguageIndependentName = "MFA Users Management"; AddUser = new Microsoft.ManagementConsole.Action("Ajouter un utilisateur", "Ajouter un utilisateur au système d'authentification MFA", -1, "AddUser"); FilterUser = new Microsoft.ManagementConsole.Action("Filtrer les utilisateurs", "Filter la liste des utilisateur", -1, "FilterUser"); ClearFilterUser = new Microsoft.ManagementConsole.Action("Effacer le Filtre utilisateurs", "Effacer les filtre de la liste des utilisateur", -1, "ClearFilterUser"); this.ActionsPaneHelpItems.Clear(); this.ActionsPaneItems.Clear(); this.EnabledStandardVerbs = StandardVerbs.None; this.HelpTopic = string.Empty; }
protected override void OnSelectionAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { switch ((int)action.Tag) { case ACTION_SHOW_CERTIFICATE: ShowCertificateDetails(); break; case ACTION_SHOW_PRIVATE_KEY: ShowPrivateKey(); break; } }
protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { base.OnAction(action, status); switch ((int)action.Tag) { case ACTION_CREATE_SELF_SIGNED_CERT: if (CreateSelfSignedCert(ServerDTO)) { OnRefresh(status); } break; } }
protected override void OnSelectionAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { string a; if ((a = (string)action.Tag) != null) { if (a == "Properties") { base.SelectionData.ShowPropertySheet("Key/Value Properties"); return; } if (!(a == "Delete")) { return; } StringBuilder stringBuilder = new StringBuilder(); foreach (ResultNode resultNode in ((IEnumerable)base.SelectedNodes)) { base.ResultNodes.Remove(resultNode); stringBuilder.Append(resultNode.DisplayName); } bizilante.SSO.Helper.SSO sSO = new bizilante.SSO.Helper.SSO(); string[] keys = sSO.GetKeys(base.ScopeNode.DisplayName); string[] values = sSO.GetValues(base.ScopeNode.DisplayName); string[] array = new string[keys.Length - 1]; string[] array2 = new string[values.Length - 1]; string b = stringBuilder.ToString(); int num = 0; if (keys.Length == 1) { array = new string[1]; array2 = new string[1]; array[0] = ""; array2[0] = ""; } else { for (int i = 0; i < keys.Length; i++) { if (!(keys[i] == b)) { array[num] = keys[i]; array2[num] = values[i]; num++; } } } sSO.CreateApplicationFieldsValues(base.ScopeNode.DisplayName, array, array2); } }
protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { base.OnAction(action, status); switch ((int)action.Tag) { case ACTION_CREATE_KEY_PAIR: if (CreateKeyPair()) { OnRefresh(status); } break; } }
protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { base.OnAction(action, status); switch ((int)action.Tag) { case ACTION_CREATE_PRIVATE_KEY: CreatePrivateKey(); break; case ACTION_CREATE_SELF_SIGNED_CERT: CreateSelfSignedCert(); break; } }
protected override void OnSelectionAction(MMCAction action, AsyncStatus status) { try { switch ((string)action.Tag) { case "Properties": this.SelectionData.ShowPropertySheet("Field Properties"); break; } } catch (Exception ex) { MsgBoxUtil.Show(this.SnapIn, ex); } }
protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { base.OnAction(action, status); switch ((int)action.Tag) { case ACTION_ADD_REVERSEZONE: AddReverseZone(); break; } }
protected override void OnSelectionAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { switch ((int)action.Tag) { case ACTION_SHOW_CERTIFICATE: ShowCertificateDetails(); break; case ACTION_REVOKE_CERTIFICATE: RevokeCertificate(); break; case ACTION_SHOW_CERTIFICATE_STRING: ShowCertificateString(); break; } }
protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { base.OnAction(action, status); switch ((int)action.Tag) { case ACTION_ADD_SERVER: AddServer(); break; } }
protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { base.OnAction(action, status); switch ((int)action.Tag) { case ACTION_SCHEMA_ADDATTRIBUTE: AddNewAttribute(); break; } }
protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { base.OnAction(action, status); switch ((int)action.Tag) { case ACTION_SCHEMA_ADDCLASS: AddObjectClass(); break; } }
/// <summary> /// Handle short cut style menu actions for selection /// </summary> /// <param name="action">triggered action</param> /// <param name="status">asynchronous status used to update the console</param> protected override void OnSelectionAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { X509Certificate cert = (X509Certificate)this.SelectedNodes[0].Tag; switch ((string)action.Tag) { case "ViewCert": SystemX509.X509Certificate2UI.DisplayCertificate(new SystemX509.X509Certificate2(cert.GetEncoded())); break; case "ExportCert": CertSave certSave = new CertSave(context.caInfo); certSave.cert = cert; this.SnapIn.Console.ShowDialog(certSave); break; case "RevokeCert": revokeCert revoke = new revokeCert(cert); if (this.SnapIn.Console.ShowDialog(revoke) == DialogResult.OK) { context.caInfo.RevokeCertificate(cert, (CRLReason)revoke.cbReason.SelectedIndex); Refresh(); } break; case "RenewCert": break; case "RekeyCert": RekeyCert rekey = new RekeyCert(context.caInfo, cert); if (this.SnapIn.Console.ShowDialog(rekey) == DialogResult.OK) { certSave = new CertSave(context.caInfo); certSave.cert = rekey.cert; this.SnapIn.Console.ShowDialog(certSave); Refresh(); } break; case "UnRevokeCert": context.caInfo.UnRevokeCertificate(cert); Refresh(); break; } }
protected override void OnSelectionAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { ProfileDb selProfile = (ProfileDb)this.SelectedNodes[0].Tag; switch ((string)action.Tag) { case "EditProfile": EditProfile editProfile = new EditProfile(selProfile.profile, false); if (this.SnapIn.Console.ShowDialog(editProfile) == DialogResult.OK) { // Save the profile to the profiles directory editProfile.profile.SaveXml(caInfo.ProfilesLocation); Refresh(); } break; case "ViewXMLProfile": ViewXml view = new ViewXml(selProfile.file); this.SnapIn.Console.ShowDialog(view); break; case "CopyProfile": EditProfile copyProfile = new EditProfile(selProfile.profile, true); if (this.SnapIn.Console.ShowDialog(copyProfile) == DialogResult.OK) { // Save the profile to the profiles directory copyProfile.profile.SaveXml(caInfo.ProfilesLocation); // Update caInfo.RefreshProfiles(); Refresh(); } break; case "DeleteProfile": DialogResult result = MessageBox.Show("Delete: " + selProfile.profile.Name, "Delete Profile", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (result == DialogResult.OK) { caInfo.RemoveProfile(selProfile); Refresh(); } break; } }
protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { base.OnAction(action, status); switch ((int)action.Tag) { case ACTION_LOGIN: Login(); break; case ACTION_SHOW_SCHEMA: try { SnapIn.Console.ShowDialog(new SchemaBrowser(_serverDTO)); } catch (Exception exp) { var mbParams = new MessageBoxParameters { Caption = "Error accessing schema", Text = exp.Message }; SnapIn.Console.ShowDialog(mbParams); } break; case ACTION_SUPERLOG: try { SnapIn.Console.ShowDialog(new SuperLogBrowser(_serverDTO)); } catch (Exception exp) { var mbParams = new MessageBoxParameters { Caption = "Error accessing superlog info", Text = exp.Message }; SnapIn.Console.ShowDialog(mbParams); } break; case ACTION_LOGOUT: Logout(); break; } }
/// <summary> /// Handle triggered action /// </summary> /// <param name="action">triggered action</param> /// <param name="status">asynchronous status to update console</param> protected override void OnSelectionAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { try { SnapInActionWindows settingAction = (SnapInActionWindows)action.Tag; switch (settingAction) { case SnapInActionWindows.Edit: this.SelectionData.ShowPropertySheet("Setting"); break; default: break; } } catch (Exception ex) { ExceptionHandlerWindows.HandleException(ex); } }
protected async override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { base.OnAction(action, status); switch ((int)action.Tag) { case ACTION_LOGIN: await DoLogin(); if (IsLoggedIn) { this.ActionsPaneItems.Remove(LoginAction); // this.ActionsPaneItems.Add(new Microsoft.ManagementConsole.Action(VMDirSchemaConstants.COMPARE_SCHEMA, VMDirSchemaConstants.COMPARE_SCHEMA, -1, ACTION_SCHEMACOMPARE)); AddLogoutActions(); PopulateChildren(); } break; case ACTION_SCHEMACOMPARE: var frm = new SchemaMetadataComparisionWindow(this); SnapIn.Console.ShowDialog(frm); break; case ACTION_LOGOUT: Logout(); break; } }
protected override void OnAction(MMCAction action, AsyncStatus status) { try { switch ((string)action.Tag) { case "AddField": this.ScopeNode.ShowPropertySheet("Add Field"); break; case "Export": string appName = this.ScopeNode.DisplayName; this.Export(appName); break; } } catch (Exception ex) { MsgBoxUtil.Show(this.SnapIn, ex); } }
public VMDNSServerNode(VMDNSServerDTO dto) : base() { ServerDTO = dto; DisplayName = ServerDTO.Server; this.ImageIndex = this.SelectedImageIndex = (int)VMDNSTreeImageIndex.Server; this.EnabledStandardVerbs = StandardVerbs.Refresh | StandardVerbs.Delete; LoginAction = new Microsoft.ManagementConsole.Action("Login", "Login", -1, ACTION_LOGIN); this.ActionsPaneItems.Add(LoginAction); }
protected override void OnAction(Action action, AsyncStatus status) { base.OnAction(action, status); switch ((ServerNodeAction)(int)action.Tag) { case ServerNodeAction.ActionLogin: var auth = (AuthTokenDto)Tag; LoginUser(auth); break; case ServerNodeAction.ActionAddExistingTenant: LoginToExistingTenant(); break; case ServerNodeAction.ActionAddTenant: AddTenant(); break; case ServerNodeAction.ActionLogout: LogoutUser(); break; case ServerNodeAction.ActionViewActiveDirectory: ShowActiveDirectory(); break; case ServerNodeAction.ActionGetComputers: ShowComputers(); break; case ServerNodeAction.ActionViewServerInfo: ShowServerInfo(); break; case ServerNodeAction.ActionTokenWizard: ShowTokenWizard(); break; } }
protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { base.OnAction(action, status); switch ((int)action.Tag) { case ACTION_PROPERTIES: ShowProperties(); break; case ACTION_RECORDADD: AddRecord(); break; } }
protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { base.OnAction(action, status); switch ((int)action.Tag) { case ACTION_LOGIN: DoLogin(); break; case ACTION_GET_STORE_VERSION: ShowStoreVersion(); break; case ACTION_CHECK_CONNECTIVITY: CheckConnectivity(); break; case ACTION_LOGOUT: DoLogout(); break; } }
/// <summary> /// Action event handler /// </summary> /// <param name="action">Action</param> /// <param name="status">Status</param> protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { try { base.OnAction(action, status); switch ((ServerNodeAction)(int)action.Tag) { case ServerNodeAction.Login: Login(); break; case ServerNodeAction.Logout: Logout(); break; } } catch (Exception exc) { PscHighAvailabilityAppEnvironment.Instance.Logger.LogException(exc); MMCDlgHelper.ShowException(exc); } }
/// <summary> /// Handle node actions /// </summary> /// <param name="action">action that was triggered</param> /// <param name="status">asynchronous status for updating the console</param> protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { switch ((string)action.Tag) { case "CreateProfile": CreateProfile newProfile = new CreateProfile(); if (this.SnapIn.Console.ShowDialog(newProfile) == DialogResult.OK) { Profile caProfile = newProfile.profile; // Update the caInfo object and save the profile ProfileDb newEntry = new ProfileDb() { profile = caProfile, file = caProfile.SaveXml(caInfo.ProfilesLocation) }; caInfo.AddProfile(newEntry); // notify any listening views that a change happened RaiseOnChange((string)action.Tag); } break; } }
protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { string a; if ((a = (string)action.Tag) != null) { if (a == "Delete") { ScopeNode scopeNode = new ScopeNode(); scopeNode.DisplayName = base.DisplayName; bizilante.SSO.Helper.SSO sSO = new bizilante.SSO.Helper.SSO(); sSO.GetApplications(); int index = 0; for (int i = 0; i < base.Parent.Children.Count; i++) { if (Parent.Children[i].DisplayName.ToUpper() == DisplayName.ToUpper()) { index = i; } } sSO.DeleteApplication(base.DisplayName); Parent.Children.RemoveAt(index); return; } if (a == "Add_KeyValue") { if (DisplayName.ToUpper() == "_NewApplication".ToUpper()) { EnabledStandardVerbs = StandardVerbs.None; } _hasKeyValuePropertyPage = true; ShowPropertySheet("Add Key/Value Pair"); OnRefresh(status); base.OnRefresh(status); return; } if (a == "Add_Application") { string[] array = new string[1]; string[] array2 = new string[1]; array[0] = ""; array2[0] = ""; string text = "_NewApplication"; bool flag = false; bizilante.SSO.Helper.SSO sSO = new bizilante.SSO.Helper.SSO(); string[] applications = sSO.GetApplications(); for (int j = 0; j < applications.Length; j++) { if (applications[j].ToUpper() == text.ToUpper()) { flag = true; } } if (flag) { MessageBoxParameters messageBoxParameters = new MessageBoxParameters(); messageBoxParameters.Text = "This application already exists"; messageBoxParameters.Caption = "Add New Application"; messageBoxParameters.Icon = MessageBoxIcon.Exclamation; SnapIn.Console.ShowDialog(messageBoxParameters); } else { ScopeNode scopeNode2 = new ScopeNode(); scopeNode2.DisplayName = "_NewApplication"; ScopeNode scopeNode3 = new ScopeNode(); Children.Add(scopeNode2); int count = Children.Count; sSO.CreateApplicationFieldsValues("_NewApplication", array, array2); Children[count - 1] = new ApplicationScopeNode("_NewApplication"); } base.OnRefresh(status); return; } if (!(a == "Export")) { if (!(a == "Import")) { return; } DialogResult dialogResult = SSOHelper.OpenSSOImportFile( out _applicationFileName, out _encryptedText, this); if (dialogResult != DialogResult.Cancel) { EncryptionKey_PropertyPage encryptionKey_PropertyPage = new EncryptionKey_PropertyPage("Import", _applicationFileName, _encryptedText); encryptionKey_PropertyPage.EncryptionKeyEnteredForImport += new EventHandler <EventArgs <bool, string> >(propertyPage_EncryptionKeyEnteredForImport); AcceptKeyForImportForm form = new AcceptKeyForImportForm(encryptionKey_PropertyPage); base.SnapIn.Console.ShowDialog(form); } base.OnRefresh(status); } else { EncryptionKey_PropertyPage encryptionKey_PropertyPage2 = new EncryptionKey_PropertyPage("Export", base.DisplayName); AcceptKeyForImportForm form2 = new AcceptKeyForImportForm(encryptionKey_PropertyPage2); base.SnapIn.Console.ShowDialog(form2); if (encryptionKey_PropertyPage2.EncryptionKey != null && encryptionKey_PropertyPage2.EncryptionKey.Length != 0) { if (!SSOHelper.ExportSSOApplication(base.DisplayName, encryptionKey_PropertyPage2.EncryptionKey, this)) { MessageBoxParameters messageBoxParameters2 = new MessageBoxParameters(); messageBoxParameters2.Text = "Error exporting the application. Please check the event log for further information"; messageBoxParameters2.Caption = "Export Application Error"; messageBoxParameters2.Icon = MessageBoxIcon.Hand; base.SnapIn.Console.ShowDialog(messageBoxParameters2); return; } } } } }
protected override void OnAction(Action action, AsyncStatus status) { base.OnAction(action, status); }
private void AddAction(ModuleAction moduleAction, string name) { Microsoft.ManagementConsole.Action action = new Microsoft.ManagementConsole.Action(); action.DisplayName = name; moduleAction.Tag = action; action.Tag = moduleAction; action.Triggered += ActionTriggeredHandler; // set image if(imageIndex.ContainsKey(moduleAction.ImageName)) { action.ImageIndex = imageIndex[moduleAction.ImageName]; } UpdateAction(action, moduleAction); view.ActionsPaneItems.Add(action); }
protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status) { base.OnAction(action, status); }