Exemple #1
0
 private void menu_load_Click(object sender, System.EventArgs e)
 {
     System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog();
     ofd.Title  = "Load Adventure";
     ofd.Filter = "Adventure Builder Files (*.adv)|*.adv";
     ofd.ShowDialog(this);
     try{
         Stream strm = ofd.OpenFile();
         AdventurePersistance pers = new AdventurePersistance(strm);
         m_graph          = (RoomGraph)pers.load();
         m_settings       = (Settings)pers.load();
         m_settings.Graph = (RoomGraph)m_graph;
         strm.Close();
         Invalidate();
     }
     catch (System.Exception ex)
     {
         Console.WriteLine(ex);
     }
 }
Exemple #2
0
 private void menu_save_Click(object sender, System.EventArgs e)
 {
     System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
     sfd.Title  = "Save Adventure";
     sfd.Filter = "Adventure Builder Files (*.adv)|*.adv";
     sfd.ShowDialog(this);
     try
     {
         Stream strm = sfd.OpenFile();
         AdventurePersistance pers = new AdventurePersistance(strm);
         pers.save(m_graph);
         pers.save(m_settings);
         m_selection = null;
         m_left_down = false;
         strm.Close();
     }
     catch (System.Exception ex)
     {
         Console.WriteLine(ex);
     }
 }
 private void menu_save_Click(object sender, System.EventArgs e)
 {
     System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
       sfd.Title = "Save Adventure";
       sfd.Filter = "Adventure Builder Files (*.adv)|*.adv";
       sfd.ShowDialog(this);
       try
       {
     Stream strm = sfd.OpenFile();
     AdventurePersistance pers = new AdventurePersistance(strm);
     pers.save(m_graph);
     pers.save(m_settings);
     m_selection = null;
     m_left_down = false;
     strm.Close();
       }
       catch (System.Exception ex)
       {
       	Console.WriteLine(ex);
       }
 }
 private void menu_load_Click(object sender, System.EventArgs e)
 {
     System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog();
       ofd.Title = "Load Adventure";
       ofd.Filter = "Adventure Builder Files (*.adv)|*.adv";
       ofd.ShowDialog(this);
       try{
     Stream strm = ofd.OpenFile();
     AdventurePersistance pers = new AdventurePersistance(strm);
     m_graph = (RoomGraph)pers.load();
     m_settings = (Settings)pers.load();
     m_settings.Graph = (RoomGraph)m_graph;
     strm.Close();
     Invalidate();
       }
       catch (System.Exception ex)
       {
       	Console.WriteLine(ex);
       }
 }