Esempio n. 1
0
 private void FinishedApplyProject(object sender, RunWorkerCompletedEventArgs args)
 {
     if (!args.Cancelled && args.Error == null)
     {
         //If successful, mark flags and put the filename in the status bar
         if (InvokeRequired)
         {
             this.Invoke((Action)(() =>
             {
                 ProgressService.StopDialog();
                 MessageBox.Show("Project successfully loaded!");
                 this.Enabled = true;
                 UpdateSelectedModule();
             }));
         }
         else
         {
             ProgressService.StopDialog();
             MessageBox.Show("Project successfully loaded!");
             this.Enabled = true;
             UpdateSelectedModule();
         }
     }
     else
     {
         ProgressService.StopDialog();
         MessageBox.Show("Error, could not open project");
     }
 }
Esempio n. 2
0
        private void FinishedSaveProject(object sender, RunWorkerCompletedEventArgs args)
        {
            bool newFile = (bool)((object[])args.Result)[0];

            if (!args.Cancelled && args.Error == null)
            {
                _loadedFilePath    = ((object[])args.Result)[1].ToString();
                statusBarFile.Text = Path.GetFileNameWithoutExtension(_loadedFilePath);

                ProgressService.StopDialog();

                if (InvokeRequired)
                {
                    this.Invoke((Action)(() =>
                    {
                        if (newFile)
                        {
                            MessageBox.Show("Project successfully saved!");
                        }
                        this.Enabled = true;
                        UpdateSelectedModule();
                    }));
                }
                else
                {
                    if (newFile)
                    {
                        MessageBox.Show("Project successfully saved!");
                    }
                    this.Enabled = true;
                    UpdateSelectedModule();
                }
            }
            else
            {
                ProgressService.StopDialog();
                MessageBox.Show("Error, could not save project");

                if (InvokeRequired)
                {
                    this.Invoke((Action)(() => { this.Enabled = true; }));
                }
                else
                {
                    this.Enabled = true;
                }
            }
        }
Esempio n. 3
0
        private static void FinishedApplyResults(object sender, RunWorkerCompletedEventArgs args)
        {
            ProgressService.StopDialog();

            if (!args.Cancelled && args.Error == null)
            {
                //Need an invoke here?
                MessageBox.Show("Rom successfully loaded!");

                ReadingFinished(false);
            }
            else
            {
                MessageBox.Show("Error, rom could not successfully load");

                ReadingFinished(true);
            }
        }
Esempio n. 4
0
        private void FinishedExportRom(object sender, RunWorkerCompletedEventArgs args)
        {
            if (!args.Cancelled && args.Error == null)
            {
                ProgressService.StopDialog();

                if (InvokeRequired)
                {
                    this.Invoke((Action)(() =>
                    {
                        MessageBox.Show("Rom successfully exported!");
                        this.Enabled = true;
                        UpdateSelectedModule();
                    }));
                }
                else
                {
                    MessageBox.Show("Rom successfully exported!");
                    this.Enabled = true;
                    UpdateSelectedModule();
                }
            }
            else
            {
                ProgressService.StopDialog();
                MessageBox.Show("Error, could not export rom");

                if (InvokeRequired)
                {
                    this.Invoke((Action)(() => { this.Enabled = true; }));
                }
                else
                {
                    this.Enabled = true;
                }
            }
        }
Esempio n. 5
0
        private void FinishedReadProject(object sender, RunWorkerCompletedEventArgs args)
        {
            if (!args.Cancelled && args.Error == null)
            {
                //If successful, mark flags and put the filename in the status bar
                if (InvokeRequired)
                {
                    this.Invoke((Action)(() =>
                    {
                        statusBarFile.Text = Path.GetFileNameWithoutExtension(openProjectDialog.FileName);
                        _loadedFilePath = openProjectDialog.FileName;
                    }));
                }
                else
                {
                    statusBarFile.Text = Path.GetFileNameWithoutExtension(openProjectDialog.FileName);
                    _loadedFilePath    = openProjectDialog.FileName;
                }

                //Load it into the Rom Project
                ApplyProjectAsync();
            }
            else
            {
                ProgressService.StopDialog();
                MessageBox.Show("Error, could not open project");
                if (InvokeRequired)
                {
                    this.Invoke((Action)(() => { this.Enabled = true; }));
                }
                else
                {
                    this.Enabled = true;
                }
            }
        }