/// <summary> /// Binds the dialog to the supplied retention policy. /// </summary> /// <param name="policy">The retention policy to bind to.</param> public void BindToPolicy(InfluxDbRetentionPolicy policy) { nameTextBox.ReadOnly = false; nameTextBox.Text = policy.Name; durationTextBox.Text = policy.Duration; replicationNumeric.Value = policy.ReplicationCopies; defaultCheckBox.Checked = policy.Default; IsCreating = false; }
// Handle changes to the selected policy private void listView_SelectedIndexChanged(object sender, EventArgs e) { if (listView.SelectedItems.Count == 0) { SelectedRetentionPolicy = null; } else { SelectedRetentionPolicy = listView.SelectedItems[0].Tag as InfluxDbRetentionPolicy; } UpdateUIState(); }