private string[] ChooseResult(DialogResult result) { if (result.Equals(DialogResult.Yes)) { using ChooseAnalysis ca = new ChooseAnalysis(); Size = new Size(5, 5); panel.Controls.Add(ca); ca.Dock = DockStyle.Fill; StartPosition = FormStartPosition.CenterScreen; ca.SendQuit += OnReceiveDialogClose; ShowDialog(); return(ca.TempText.Split('.')); } else if (result.Equals(DialogResult.No)) { using Progress pro = new Progress(); Size = new Size(5, 5); StartPosition = FormStartPosition.Manual; Location = new Point(1, 1010); panel.Controls.Add(pro); pro.Dock = DockStyle.Fill; SendRate += pro.Rate; new Task(() => BackTesting(pro, string.Concat(Environment.CurrentDirectory, @"\Statistics\", DateTime.Now.Hour > 23 || DateTime.Now.Hour < 9 ? DateTime.Now.AddDays(-1).ToString("yyMMdd") : DateTime.Now.ToString("yyMMdd"), ".csv"), string.Concat(Environment.CurrentDirectory, @"\Log\", DateTime.Now.Hour > 23 || DateTime.Now.Hour < 9 ? DateTime.Now.AddDays(-1).ToString("yyMMdd") : DateTime.Now.ToString("yyMMdd"), @"\"))).Start(); SendRate?.Invoke(this, new ProgressRate(Reaction * smp.Length * sdp.Length * lmp.Length * ldp.Length)); ShowDialog(); } Dispose(); Environment.Exit(0); return(null); }
private void ChooseStrategy(ChooseAnalysis analysis, SelectStrategies strategy) { analysis.SendClose += strategy.OnReceiveClose; strategy.OnReceiveClose(analysis.Key.Split('^')); splitContainerStrategy.Panel1.Controls.Add(analysis); splitContainerStrategy.Panel2.Controls.Add(strategy); analysis.Dock = DockStyle.Fill; strategy.Dock = DockStyle.Fill; Size = new Size(1650, 920); splitContainerStrategy.SplitterDistance = 287; splitContainerStrategy.BackColor = Color.FromArgb(121, 133, 130); strategy.SendClose += OnReceiveClose; ShowDialog(); }
private void ChooseStrategy(DialogResult result, GuideGoblinBat guide, ChooseAnalysis analysis, SelectStrategies strategy) { analysis.SendClose += strategy.OnReceiveClose; strategy.OnReceiveClose(analysis.Key.Split('^')); splitContainerStrategy.Panel1.Controls.Add(analysis); splitContainerStrategy.Panel2.Controls.Add(strategy); splitContainerGuide.Panel1.Controls.Add(guide); analysis.Dock = DockStyle.Fill; strategy.Dock = DockStyle.Fill; guide.Dock = DockStyle.Fill; font = result; Size = new Size(1650, 920); splitContainerStrategy.SplitterDistance = 287; splitContainerStrategy.BackColor = Color.FromArgb(121, 133, 130); splitContainerGuide.Panel1.BackColor = Color.FromArgb(121, 133, 130); strategy.SendClose += OnReceiveClose; strategy.OnReceiveColor(analysis.ColorFactory); SetControlsChangeFont(result, Controls, new Font("Consolas", Font.Size, FontStyle.Regular)); ResumeLayout(); ShowDialog(); }
private string[] ChooseResult(DialogResult result) { if (result.Equals(DialogResult.Yes)) { using ChooseAnalysis ca = new ChooseAnalysis(); Size = new Size(5, 5); tableLayoutPanel.RowStyles.Clear(); tableLayoutPanel.Controls.Add(webBrowser, 0, tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 0))); tableLayoutPanel.Controls.Add(panel, 0, tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100))); panel.Controls.Add(ca); ca.Dock = DockStyle.Fill; ca.SendQuit += OnReceiveDialogClose; ShowDialog(); return(ca.TempText.Split('.')); } else if (result.Equals(DialogResult.No)) { using Progress pro = new Progress(); tableLayoutPanel.RowStyles.Clear(); tableLayoutPanel.Controls.Add(webBrowser, 0, tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 70))); tableLayoutPanel.Controls.Add(panel, 0, tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 31))); panel.Controls.Add(pro); pro.Dock = DockStyle.Fill; panel.BorderStyle = BorderStyle.None; WindowState = FormWindowState.Maximized; webBrowser.Show(); SendRate += pro.Rate; new Task(() => BackTesting(pro, string.Concat(Environment.CurrentDirectory, @"\Statistics\", DateTime.Now.Hour > 23 || DateTime.Now.Hour < 9 ? DateTime.Now.AddDays(-1).ToString("yyMMdd") : DateTime.Now.ToString("yyMMdd"), ".csv"), string.Concat(Environment.CurrentDirectory, @"\Log\", DateTime.Now.Hour > 23 || DateTime.Now.Hour < 9 ? DateTime.Now.AddDays(-1).ToString("yyMMdd") : DateTime.Now.ToString("yyMMdd"), @"\"))).Start(); SendRate?.Invoke(this, new ProgressRate(Reaction * smp.Length * sdp.Length * lmp.Length * ldp.Length)); ShowDialog(); } Dispose(); Environment.Exit(0); return(null); }