Пример #1
0
 public GameSessionWindow(Game.Session session)
 {
     Session = session;
     Scene   = new SceneTree.Scene(Session);
     InitializeComponent();
     DataContext = this;
 }
Пример #2
0
 void OpenCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     try {
         var savePath = App.ShowLoadGameDialog(this);
         if (savePath == null)
         {
             return;
         }
         using (var stream = File.OpenRead(savePath)) {
             Session = Game.Session.ReadFromStream(stream);
         }
     } catch (Exception ex) {
         MessageBox.Show(
             caption: "Error",
             icon: MessageBoxImage.Error,
             messageBoxText: ex.Message,
             button: MessageBoxButton.OK
             );
     }
     Scene = new SceneTree.Scene(Session);
 }