/// <summary> /// OnInitialize method /// </summary> protected virtual void OnInitialize() { this.Cursor = Cursors.WaitCursor; this.SuspendLayout(); try { ControlInstance = new ConfigurationControl(this, this.SnapIn); this.tableLayoutPanel.Controls.Add(ControlInstance, 0, 1); bool isconfigured = ManagementService.ADFSManager.IsFarmConfigured(); _lst.Clear(); if (isconfigured) { int i = 3; foreach (ADFSServerHost srv in ManagementService.ADFSManager.ADFSFarm.Servers) { bool isok = ManagementService.ADFSManager.IsRunning(srv.FQDN); ADFSServerControl crt = new ADFSServerControl(this, srv, isok); _lst.Add(crt); this.tableLayoutPanel.Controls.Add(crt, 0, i); i++; } } } finally { this.ResumeLayout(true); this.Cursor = Cursors.Default; } }
/// <summary> /// ReloadData method implementation /// </summary> internal void ReloadData() { this.SuspendLayout(); this.Cursor = Cursors.WaitCursor; _notifenabled = false; try { ComponentResourceManager resources = new ComponentResourceManager(typeof(ServiceViewControl)); this.label1.Text = resources.GetString("label1.Text"); this.label2.Text = resources.GetString("label2.Text"); this.label3.Text = resources.GetString("label3.Text"); this.label4.Text = resources.GetString("label4.Text"); ((IMMCRefreshData)ControlInstance).DoRefreshData(); bool isconfigured = ManagementService.ADFSManager.IsFarmConfigured(); if (isconfigured) { foreach (ADFSServerControl srv in _lst) { this.tableLayoutPanel.Controls.Remove(srv); } _lst.Clear(); int i = 3; MFAConfig cfg = CFGUtilities.ReadConfiguration(null); foreach (ADFSServerHost srv in cfg.Hosts.ADFSFarm.Servers) { bool isok = ManagementService.ADFSManager.IsRunning(srv.FQDN); ADFSServerControl crt = new ADFSServerControl(this, srv, isok); _lst.Add(crt); this.tableLayoutPanel.Invoke((MethodInvoker) delegate { this.tableLayoutPanel.Controls.Add(crt, 0, i); }); i++; } } } finally { _notifenabled = true; this.Cursor = Cursors.Default; this.ResumeLayout(); } }