private void DeleteManagedEndpoint_Click(object sender, EventArgs e) { if (current != null) { this.endpoints.Remove(current); current = null; this.RefreshList(); } }
private void DoUpdate() { current = ManagedEndpointList.SelectedItem as ManagedEndpoint; if (current != null) { current.Name = ManagedEndpointName.Text; current.Queue = ManagedEndpointQueue.Text; Manager.StoreManagedEndpoints(this.endpoints); this.RefreshList(); } }
private void RefreshList() { this.ManagedEndpointList.SuspendLayout(); object selected = this.ManagedEndpointList.SelectedItem; this.ManagedEndpointList.DataSource = null; this.ManagedEndpointList.DataSource = endpoints; this.ManagedEndpointList.SelectedItem = selected; this.ManagedEndpointList.ResumeLayout(true); current = this.ManagedEndpointList.SelectedItem as ManagedEndpoint; }
private void DoAdd() { ManagedEndpoint endpoint = new ManagedEndpoint(); endpoint.Name = ManagedEndpointName.Text; endpoint.Queue = ManagedEndpointQueue.Text; endpoints.Add(endpoint); Manager.StoreManagedEndpoints(this.endpoints); this.RefreshList(); this.ManagedEndpointList.SelectedItem = endpoint; this.PrepareForUpdate(); }
private void PrepareForAdd() { this.ManagedEndpointButton.Text = "Add"; this.ManagedEndpointName.Text = string.Empty; this.ManagedEndpointQueue.Text = string.Empty; this.MessagesInEndpoint.Text = "?"; this.AgeOfOldestMessage.Text = "?"; current = null; this.DeleteManagedEndpoint.Enabled = false; this.RefreshWorkerList(); }
private void PrepareForUpdate() { current = ManagedEndpointList.SelectedItem as ManagedEndpoint; if (current != null) { this.ManagedEndpointButton.Text = "Update"; this.ManagedEndpointName.Text = current.Name; this.ManagedEndpointQueue.Text = current.Queue; this.UpdateManagedEndpoint(); this.DeleteManagedEndpoint.Enabled = true; this.RefreshWorkerList(); } }