Beispiel #1
0
 private void butSavLoadDefault_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         SavTab.SavPath = SavTab.GetDefaultSavPath();
     }
     catch (Exception ex)
     {
         MessageBox.Show(
             ex.Message,
             "Error loading default .sav",
             MessageBoxButton.OK,
             MessageBoxImage.Error);
     }
 }
Beispiel #2
0
 private void butSavExport_Click(object sender, RoutedEventArgs e)
 {
     Cursor = Cursors.Wait;
     try
     {
         SavTab.Export(PawnModel.LoadedPawn);
     }
     catch (Exception ex)
     {
         MessageBox.Show(
             ex.Message,
             "Error exporting to .sav",
             MessageBoxButton.OK,
             MessageBoxImage.Error);
     }
     Cursor = Cursors.Arrow;
 }
Beispiel #3
0
        public MainWindow()
        {
            InitializeComponent();
            DataContext = this;

            SavTab = new SavTab();

            try
            {
                InitializeConfig();
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format(
                    "{0}\n\nPawnManager requires the config file.  Sorry, but I have to close now.",
                    ex.Message),
                    "Error reading config",
                    MessageBoxButton.OK,
                    MessageBoxImage.Error);
                Application.Current.Shutdown();
            }
        }
Beispiel #4
0
        public MainWindow()
        {
            InitializeComponent();
            DataContext = this;

            SavTab = new SavTab();

            try
            {
                InitializeConfig();
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format(
                                    "{0}\n\nPawnManager requires the config file.  Sorry, but I have to close now.",
                                    ex.Message),
                                "Error reading config",
                                MessageBoxButton.OK,
                                MessageBoxImage.Error);
                Application.Current.Shutdown();
            }
        }
Beispiel #5
0
        private void butSavImport_Click(object sender, RoutedEventArgs e)
        {
            Cursor = Cursors.Wait;
            PawnData result = null;

            try
            {
                result = SavTab.Import();
            }
            catch (Exception ex)
            {
                MessageBox.Show(
                    ex.Message,
                    "Error importing from .sav",
                    MessageBoxButton.OK,
                    MessageBoxImage.Error);
            }
            if (result != null)
            {
                SetLoadedPawn(result);
            }
            Cursor = Cursors.Arrow;
        }