Example #1
0
        public static void StartDisplay(string message)
        {
            EndDisplay();

            MainWin.I.BeginInvoke((MethodInvoker) delegate
            {
                Dlg = new LiteStatusDlg();
                Dlg.Prm_StatusMessage = message;
                Dlg.Show();
            });
        }
Example #2
0
 public static void EndDisplay()
 {
     MainWin.I.BeginInvoke((MethodInvoker) delegate
     {
         if (Dlg != null)
         {
             Dlg.Close();
             Dlg.Dispose();                     // 2bs -- .Show() の場合は Dispose 不要である。
             Dlg = null;
         }
     });
 }
Example #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();
        }