private void NewVSD_Click(object sender, RoutedEventArgs e) { Tools.New_VSD_Name_File vsdInfo = new Tools.New_VSD_Name_File(); if (vsdInfo.ShowDialog() == true) { m_CurrentVirtualDeck = new VirtualDeck { m_File = vsdInfo.m_DeckFile, m_Title = vsdInfo.m_DeckName }; } m_CurrentVirtualDeck.SaveToFile(); }
public void LoadFromFile(string file) { try { Stream stream = new FileStream(file, FileMode.Open, FileAccess.Read); IFormatter formatter = new BinaryFormatter(); VirtualDeck v = (VirtualDeck)formatter.Deserialize(stream); m_Pages = v.m_Pages; m_File = v.m_File; m_Title = v.m_Title; } catch (Exception ex) { MessageBox.Show(ex.Message); } }