public static SuccessMovingWindow getInstance(int currentQuantity, int finalQuantity) { if (instance == null) { instance = new SuccessMovingWindow(currentQuantity, finalQuantity); } return(instance); }
private void confirmButton_Click(object sender, RoutedEventArgs e) { nextRoom = (Room)nextRoomComboBox.SelectedItem; quantityForMove = int.TryParse(quantityTextBox.Text, out quantityForMove) ? quantityForMove : 0; if (AllInputsAreValid()) { CreateThreadForMovingEquipment(CreateDateTimeObject()); SuccessMovingWindow.getInstance(quantityOfSelectedEquipment, quantityOfSelectedEquipment - quantityForMove).Show(); this.Close(); } else { MessageBox.Show("Niste uneli sve informacije!", "Greška", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { instance = null; }