private void LoadFiles(object data)
        {
            string[] files = (string[])data;

            OnImportStarted();
#if !DEBUG
            try
#endif
            {
                GameStructure = GameStructure.Load(files);
            }
#if !DEBUG
            catch (SerializedFileException ex)
            {
                ReportCrash(ex);
                return;
            }
            catch (Exception ex)
            {
                ReportCrash(ex);
                return;
            }
#endif

            if (GameStructure.IsValid)
            {
                Validate();
            }
            OnImportFinished();

            if (GameStructure.IsValid)
            {
                Dispatcher.Invoke(() =>
                {
                    IntroText.Text         += "Files have been loaded";
                    ExportButton.Visibility = Visibility.Visible;

                    Fileview.AddItem(GameStructure.FileCollection);
                    Fileview.Refresh();

#if VIRTUAL
                    OnExportButtonClicked(null, null);
#endif
                }
                                  );
            }
            else
            {
                Dispatcher.Invoke(() =>
                {
                    OnResetButtonClicked(null, null);
                    Logger.Log(LogType.Warning, LogCategory.Import, "No game files found");
                }
                                  );
            }
        }
Exemple #2
0
        private void OnResetButtonClicked(object sender, RoutedEventArgs e)
        {
            Fileview.Clear();
            IntroText.Text              = m_initialIntroText;
            StatusText.Content          = m_initialStatusText;
            MainGrid.AllowDrop          = true;
            PostExportButton.Visibility = Visibility.Hidden;
            ResetButton.Visibility      = Visibility.Hidden;
            OutputView.Clear();
            m_processingFiles = null;

            GameStructure.Dispose();
        }
        private void LoadFiles(object data)
        {
            string[] files = (string[])data;

#if !DEBUG
            try
#endif
            {
                OnImportStarted();
                GameStructure = GameStructure.Load(files);
                Validate();
                OnImportFinished();
            }
#if !DEBUG
            catch (SerializedFileException ex)
            {
                ReportCrash(ex);
                return;
            }
            catch (Exception ex)
            {
                ReportCrash(ex);
                return;
            }
#endif

            Dispatcher.Invoke(() =>
            {
                IntroText.Text          = "Files has been loaded";
                ExportButton.Visibility = Visibility.Visible;

                Fileview.AddItem(GameStructure.FileCollection);
                Fileview.Refresh();

#if VIRTUAL
                ButtonAutomationPeer peer  = new ButtonAutomationPeer(ExportButton);
                IInvokeProvider invokeProv = peer.GetPattern(PatternInterface.Invoke) as IInvokeProvider;
                invokeProv.Invoke();
#endif
            }
                              );
        }