private void miLogin_Click(object sender, RoutedEventArgs e) { var loginF = new LoginWindow(); loginF.Owner = this; loginF.ShowDialog(); }
private void MainForm_Loaded(object sender, RoutedEventArgs e) { if (File.Exists(SerializationFile)) using (Stream DeserializationStream = File.OpenRead(SerializationFile)) { BinaryFormatter deserializer = new BinaryFormatter(); Employee.Employees = (List<Employee>)deserializer.Deserialize(DeserializationStream); PlaceTrading.PlacesTrading = (Dictionary<Guid, PlaceTrading>)deserializer.Deserialize(DeserializationStream); Order.Orders = (List<Order>)deserializer.Deserialize(DeserializationStream); Product.Products = (Dictionary<int, Product>)deserializer.Deserialize(DeserializationStream); User.Users = (List<User>)deserializer.Deserialize(DeserializationStream); ProductInPlaceTrading.ProductInPlacesTrading = (List<ProductInPlaceTrading>)deserializer.Deserialize(DeserializationStream); } else { MessageBox.Show("Попередніх даних не знайдено."); } var loginF = new LoginWindow(); loginF.Owner = this; loginF.ShowDialog(); }