/// <summary> /// Called when the <see cref="F:Microsoft.ManagementConsole.StandardVerbs.Delete"></see> standard verb is triggered. /// </summary> /// <param name="status">An object that holds the status information.</param> protected override void OnDelete(SyncStatus status) { string companyId = this.CompanyInfo.Id; string domainName = this.DisplayName; DeleteCompanyForm form = new DeleteCompanyForm(GetCompanyConfigurator(), companyId, domainName); if (this.SnapIn.Console.ShowDialog(form) == DialogResult.OK) { status.ReportProgress(0, 0, string.Format(SnapInResources.CompanyScopeNode_Action_Delete_Progress, domainName)); //Thread.Sleep(10000); GetCompanyConfigurator().DeleteCompany(companyId, form.DeleteDatabase); // Refresh ServerFormView ServerScopeNode serverScopeNode = ((ServerScopeNode)this.Parent.Parent); if (serverScopeNode.ServerFormView != null && serverScopeNode.ServerFormView.ServerFeaturesControl != null) { serverScopeNode.ServerFormView.ServerFeaturesControl.LoadDataFromConfigurator(); } // Remove Current Element From Tree this.Parent.Children.Remove(this); } }
/// <summary> /// Called when the <see cref="F:Microsoft.ManagementConsole.StandardVerbs.Delete"></see> standard verb is triggered. /// </summary> /// <param name="status">An object that holds the status information.</param> protected override void OnDelete(SyncStatus status) { string companyId = this.CompanyInfo.Id; string domainName = this.DisplayName; DeleteCompanyForm form = new DeleteCompanyForm(GetCompanyConfigurator(), companyId, domainName); if (this.SnapIn.Console.ShowDialog(form) == DialogResult.OK) { status.ReportProgress(0, 0, string.Format(SnapInResources.CompanyScopeNode_Action_Delete_Progress, domainName)); //Thread.Sleep(10000); GetCompanyConfigurator().DeleteCompany(companyId, form.DeleteDatabase); // Refresh ServerFormView ServerScopeNode serverScopeNode = ((ServerScopeNode)this.Parent.Parent); if (serverScopeNode.ServerFormView != null && serverScopeNode.ServerFormView.ServerFeaturesControl != null) { serverScopeNode.ServerFormView.ServerFeaturesControl.LoadDataFromConfigurator(); } // Remove Current Element From Tree this.Parent.Children.Remove(this); } }