Beispiel #1
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (w1 != null)
         w1.Close();
     if (w2 != null)
         w2.Close();
     Serializer slcl1 = new Serializer("Playlists.txt", true);
     Serializer slcl2 = new Serializer("Compositions.txt", true);
     slcl1.WriteObject(playlists);
     slcl2.WriteObject(compositions);
     slcl1.Close();
     slcl2.Close();
 }
Beispiel #2
0
 public MainWindow()
 {
     InitializeComponent();
     if (File.Exists("Playlists.txt"))
     {
         Serializer slop1 = new Serializer("Playlists.txt", false);
         playlists = (PlaylistCollection)slop1.ReadObject();
         slop1.Close();
     }
     if (File.Exists("Compositions.txt"))
     {
         Serializer slop2 = new Serializer("Compositions.txt", false);
         compositions = (CompositionCollection)slop2.ReadObject();
         slop2.Close();
     }
     listbox1.ItemsSource = playlists;
 }