private void OKButton_Click(object sender, EventArgs e) { if (!String.IsNullOrEmpty(VolumeLabel.Text)) { Drive.Format(Int32.Parse(Capacity.Text), Int32.Parse(AllocationUnitSize.Text), VolumeLabel.Text); DialogResult = true; } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (String.IsNullOrEmpty(VolumeLabel.Text)) { e.Cancel = true; MessageBox.Show(this, $"Enter volume name.", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Warning); } else { Drive.Format(Int32.Parse(Capacity.Text), Int32.Parse(AllocationUnitSize.Text), VolumeLabel.Text); DialogResult = true; } }
public MainWindow() { Drive.Format(256, 4, "Artemiy"); InitializeComponent(); DrawGrid(); }