private void UpdateDiskSize() { // Don't use DiskSizeNumericUpDown.Value here, as it will fire the NumericUpDown built-in validation. Use Text property instead. (CA-46028) decimal newValue; if (decimal.TryParse(DiskSizeNumericUpDown.Text.Trim(), out newValue)) { try { SrListBox.DiskSize = (long)(Math.Round(newValue * GetUnits())); if (IsSelectedSRThinProvisioned && userChangedInitialAllocationValue) { SrListBox.OverridenInitialAllocationRate = initialAllocationNumericUpDown.Value / 100; } } catch (OverflowException) { //CA-71312 SrListBox.DiskSize = newValue < 0 ? long.MinValue : long.MaxValue; } SrListBox.refresh(); } RefreshMinSize(); updateErrorsAndButtons(); }
private void UpdateDiskSize() { // Don't use DiskSizeNumericUpDown.Value here, as it will fire the NumericUpDown built-in validation. Use Text property instead. (CA-46028) decimal newValue; if (decimal.TryParse(DiskSizeNumericUpDown.Text.Trim(), out newValue)) { try { SrListBox.DiskSize = (long)(Math.Round(newValue * GetUnits())); } catch (OverflowException) { //CA-71312 SrListBox.DiskSize = newValue < 0 ? long.MinValue : long.MaxValue; } SrListBox.refresh(); } RefreshMinSize(); updateErrorsAndButtons(); }