Beispiel #1
0
        private void MainWin_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.mtEnabled = false;

            confirmSaveFile(false, true, false);

            Gnd.i.logger.writeLine("MainWinを閉じます。");

            self = null;
        }
Beispiel #2
0
        public MainWin()
        {
            self = this;

            InitializeComponent();

            this.MinimumSize    = this.Size;
            this.lblStatus.Text = "";

            refreshTitle();
            //refreshVideo(); // moved -> _Shown
        }
Beispiel #3
0
        private void MainWin_Shown(object sender, EventArgs e)
        {
            {
                string logFile = ProcMain.SelfFile + ".G3_MainWin.log";

                SCommon.DeletePath(logFile);

                ProcMain.WriteLog = message =>
                {
                    using (StreamWriter writer = new StreamWriter(logFile, true, Encoding.UTF8))
                    {
                        writer.WriteLine("[" + DateTime.Now + "] " + message);
                    }
                };
            }

            bool aliving = true;

            this.PostGameStart_G3 = () =>
            {
                this.BeginInvoke((MethodInvoker) delegate
                {
                    if (aliving)
                    {
                        this.Visible = false;
                    }
                });

                this.PostGameStart_G3 = null;
            };

            Thread th = new Thread(() =>
            {
                I = this;
                new Program2().Main2();
                LiteStatusDlg.EndDisplay();
                I = null;

                this.BeginInvoke((MethodInvoker) delegate
                {
                    aliving = false;
                    this.Close();
                });
            });

            th.Start();
        }
Beispiel #4
0
        private void MainWin_Shown(object sender, EventArgs e)
        {
            ProcMain.WriteLog = message =>
            {
                if (message is Exception)
                {
                    throw new AggregateException((Exception)message);
                }
                else
                {
                    throw new Exception("Bad log: " + message);
                }
            };

            bool aliving = true;

            DDAdditionalEvents.PostGameStart_G2 = () =>
            {
                this.BeginInvoke((MethodInvoker) delegate
                {
                    if (aliving)
                    {
                        this.Visible = false;
                    }
                });
            };

            Thread th = new Thread(() =>
            {
                I = this;
                new Program2().Main2();
                I = null;

                this.BeginInvoke((MethodInvoker) delegate
                {
                    aliving = false;
                    this.Close();
                });
            });

            th.Start();
        }
Beispiel #5
0
 private void MainWin_FormClosed(object sender, FormClosedEventArgs e)
 {
     self = null;
 }
Beispiel #6
0
        public MainWin()
        {
            self = this;

            InitializeComponent();
        }
Beispiel #7
0
        private void perform()
        {
            if (FFmpeg.isFFmpegDir(Gnd.i.ffmpegDir) == false)
            {
                using (FFmpegDirDlg f = new FFmpegDirDlg())
                {
                    f.ShowDialog();
                }
                if (Gnd.i.ffmpegDir == "")
                {
                    throw new Cancelled("ffmpeg のパスが指定されていないため、続行出来ません。");
                }
                if (FFmpeg.isFFmpegDir(Gnd.i.ffmpegDir) == false)
                {
                    throw new Cancelled("ffmpeg のパスが見つからないため、続行出来ません。");
                }
            }

            try
            {
                BusyDlg.perform(delegate
                {
                    FFmpegBin.i = new FFmpegBin(FFmpeg.getBinDir());

                    try
                    {
                        FFmpegBinTester.doTest();
                    }
                    catch (Exception e)
                    {
                        Gnd.i.ffmpegDir = "";                         // 次回起動時に再設定出来るように..
                        throw new ExceptionCarrier(e);
                    }

                    if (Gnd.i.bootOpenFile != null)
                    {
                        Gnd.i.md = new MediaData(Gnd.i.bootOpenFile);
                    }
                });

                using (MainWin f = new MainWin())
                {
                    f.ShowDialog();
                }
            }
            finally
            {
                BusyDlg.perform(delegate
                {
                    if (Gnd.i.md != null)
                    {
                        Gnd.i.md.Dispose();
                        Gnd.i.md = null;
                    }
                    if (Gnd.i.qsd != null)
                    {
                        Gnd.i.qsd.Dispose();
                        Gnd.i.qsd = null;
                    }
                    if (FFmpegBin.i != null)
                    {
                        FFmpegBin.i.Dispose();
                        FFmpegBin.i = null;
                    }
                });
            }
        }