/// <summary> /// The ButtonAdd_Click method. /// </summary> /// <param name="sender">The <paramref name="sender"/> parameter.</param> /// <param name="args">The <paramref name="args"/> parameter.</param> private void ButtonAdd_Click(object sender, System.EventArgs args) { if (string.IsNullOrEmpty(tbxName.Text)) { return; } if (SelectedVolumeGroup != null) { if (SelectedVolumeGroup.Name != tbxName.Text) { SelectedVolumeGroup.Name = tbxName.Text; } if (SelectedVolumeGroup.IsArchiveGroup != cbxArchiveGroup.Checked) { SelectedVolumeGroup.IsArchiveGroup = cbxArchiveGroup.Checked; } } else { var newVolumeGroup = new NewVolumeGroup(); newVolumeGroup.Name = tbxName.Text; newVolumeGroup.IsArchiveGroup = cbxArchiveGroup.Checked; CurrentStorageConfig.CreateVolumeGroup(newVolumeGroup); } }
/// <summary> /// The ButtonAdd_Click method. /// </summary> /// <param name="sender">The <paramref name="sender"/> parameter.</param> /// <param name="args">The <paramref name="args"/> parameter.</param> private void ButtonAdd_Click(object sender, System.EventArgs args) { if (string.IsNullOrEmpty(tbxPath.Text)) { return; } if (SelectedVolume != null) { if (SelectedVolume.Path != tbxPath.Text) { SelectedVolume.Path = tbxPath.Text; } if (SelectedVolume.Username != tbxUsername.Text) { SelectedVolume.Username = tbxUsername.Text; } if (!string.IsNullOrEmpty(tbxPassword.Text)) { SelectedVolume.Password = tbxPassword.Text; } if (SelectedVolume.Domain != tbxDomain.Text) { SelectedVolume.Domain = tbxDomain.Text; } if (Math.Abs(SelectedVolume.Buffer - (float)nudBuffer.Value) > 0) { SelectedVolume.Buffer = (float)nudBuffer.Value; } if (SelectedVolume.IsBandwidthReserved != cbxReserveBandwidth.Checked) { SelectedVolume.IsBandwidthReserved = cbxReserveBandwidth.Checked; } } else { var newVolume = new NewVolume(); newVolume.Path = tbxPath.Text; newVolume.Username = tbxUsername.Text; newVolume.Password = tbxPassword.Text; newVolume.Domain = tbxDomain.Text; newVolume.Buffer = (float)nudBuffer.Value; newVolume.IsBandwidthReserved = cbxReserveBandwidth.Checked; CurrentStorageConfig.CreateVolume(newVolume); } }