private void Planner_TabIndexChanged(object sender, EventArgs e) { if (ConfigTabs.SelectedTab == TabSetup) { if (!MainV2.comPort.BaseStream.IsOpen) { MessageBox.Show("Please Connect First"); ConfigTabs.SelectedIndex = 0; } else { Setup.Setup temp = new Setup.Setup(); temp.Configuration = this; MainV2.fixtheme(temp); temp.ShowDialog(); startup = true; processToScreen(); startup = false; } } }
private void BUT_setup_Click(object sender, EventArgs e) { Form temp = new Setup.Setup(); MainV2.fixtheme(temp); temp.ShowDialog(); }
private void BUT_setup_Click(object sender, EventArgs e) { Form temp = new Setup.Setup(); ThemeManager.ApplyThemeTo(temp); temp.ShowDialog(); }
void Setup() { do { using (var setup = new Setup.Setup()) { var ret = setup.ShowDialog(); if (ret == DialogResult.OK) { this.statusLabel.Text = "オペレーションを開始しています..."; operationStarting.Visible = true; this.Refresh(); this.Enabled = false; Application.DoEvents(); Core.IsOperationCreated = false; var act = new Func <Data.Operation>(setup.GetOperationData); act.BeginInvoke((iar) => { this.Invoke(new Action(() => { Core.CurrentOperation = ((Func <Data.Operation>)iar.AsyncState).EndInvoke(iar); Core.IsOperationCreated = true; })); } , act); while (!Core.IsOperationCreated) { Application.DoEvents(); System.Threading.Thread.Sleep(0); } if (Core.CurrentOperation == null) { MessageBox.Show( "振り分ける対象のファイルがありません。" + Environment.NewLine + "設定し直してください。", "スタートエラー", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { Core.CurrentOperation.Data.ElementsUpdated += new Action(ItemLengthLabelUpdate); Core.CurrentOperation.IndexUpdated += new Action(ItemLengthLabelUpdate); Core.CurrentOperation.IndexUpdated += new Action(CheckFinished); Core.CurrentOperation.IndexUpdated += new Action(UpdateControlItems); ItemLengthLabelUpdate(); UpdateControlItems(); } this.Enabled = true; this.statusLabel.Text = "完了"; operationStarting.Visible = false; this.Refresh(); Application.DoEvents(); } else if (ret == DialogResult.Retry) { var retry = setup.RetryOperationDataFile; if (MessageBox.Show(retry + "からデータを読み込んで再開します。" + Environment.NewLine + "よろしいですか?", "振り分けの再開", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Core.CurrentOperation = Subsystem.OperationPackager.Load(retry); } Core.CurrentOperation.Data.ElementsUpdated += new Action(ItemLengthLabelUpdate); Core.CurrentOperation.IndexUpdated += new Action(ItemLengthLabelUpdate); Core.CurrentOperation.IndexUpdated += new Action(CheckFinished); Core.CurrentOperation.IndexUpdated += new Action(UpdateControlItems); ItemLengthLabelUpdate(); UpdateControlItems(); this.Enabled = true; this.statusLabel.Text = "完了"; operationStarting.Visible = false; this.Refresh(); Core.CurrentOperation.Reload(); Application.DoEvents(); } else { Application.Exit(); break; } } Application.DoEvents(); } while (Core.CurrentOperation == null); }
void Setup() { do { using (var setup = new Setup.Setup()) { var ret = setup.ShowDialog(); if (ret == DialogResult.OK) { this.statusLabel.Text = "オペレーションを開始しています..."; operationStarting.Visible = true; this.Refresh(); this.Enabled = false; Application.DoEvents(); Core.IsOperationCreated = false; var act = new Func<Data.Operation>(setup.GetOperationData); act.BeginInvoke((iar) => { this.Invoke(new Action(() => { Core.CurrentOperation = ((Func<Data.Operation>)iar.AsyncState).EndInvoke(iar); Core.IsOperationCreated = true; })); } , act); while (!Core.IsOperationCreated) { Application.DoEvents(); System.Threading.Thread.Sleep(0); } if (Core.CurrentOperation == null) { MessageBox.Show( "振り分ける対象のファイルがありません。" + Environment.NewLine + "設定し直してください。", "スタートエラー", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { Core.CurrentOperation.Data.ElementsUpdated += new Action(ItemLengthLabelUpdate); Core.CurrentOperation.IndexUpdated += new Action(ItemLengthLabelUpdate); Core.CurrentOperation.IndexUpdated += new Action(CheckFinished); Core.CurrentOperation.IndexUpdated += new Action(UpdateControlItems); ItemLengthLabelUpdate(); UpdateControlItems(); } this.Enabled = true; this.statusLabel.Text = "完了"; operationStarting.Visible = false; this.Refresh(); Application.DoEvents(); } else if (ret == DialogResult.Retry) { var retry = setup.RetryOperationDataFile; if (MessageBox.Show(retry + "からデータを読み込んで再開します。" + Environment.NewLine + "よろしいですか?", "振り分けの再開", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Core.CurrentOperation = Subsystem.OperationPackager.Load(retry); } Core.CurrentOperation.Data.ElementsUpdated += new Action(ItemLengthLabelUpdate); Core.CurrentOperation.IndexUpdated += new Action(ItemLengthLabelUpdate); Core.CurrentOperation.IndexUpdated += new Action(CheckFinished); Core.CurrentOperation.IndexUpdated += new Action(UpdateControlItems); ItemLengthLabelUpdate(); UpdateControlItems(); this.Enabled = true; this.statusLabel.Text = "完了"; operationStarting.Visible = false; this.Refresh(); Core.CurrentOperation.Reload(); Application.DoEvents(); } else { Application.Exit(); break; } } Application.DoEvents(); } while (Core.CurrentOperation == null); }