private void MainWindow_Shown(object sender, EventArgs e) { // speeds up data grid view performance. typeof(DataGridView).InvokeMember("DoubleBuffered", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty, null, dgPrices, new object[] { true }); typeof(DataGridView).InvokeMember("DoubleBuffered", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty, null, dgServices, new object[] { true }); dgServices.AutoGenerateColumns = false; dgServices.DataSource = new SortableBindingList <IService>(_engine.Services); dgPrices.AutoGenerateColumns = false; dgPrices.DataSource = new SortableBindingList <PriceEntryBase>(_engine.PriceEntries); if (!_engine.DoDonationMinging) { textDonationStart.Enabled = false; textDonationEnd.Enabled = false; } lblCurrencySymbol.Text = string.Empty; // Avoid flashing template value when starting if (!_engine.RemoteReceive) { tabPage.TabPages.Remove(tabRemote); } UpdateButtons(); RunCycle(); UpdateGrid(true); if (Program.MinimizeOnStart) { MinimizeWindow(); } tmrPriceCheck.Enabled = true; if (!string.IsNullOrWhiteSpace(_engine.CurrencyCode)) { tmrExchangeUpdate.Enabled = true; } if (Program.HasAutoStart) { _engine.MiningMode = MiningModeEnum.Automatic; UpdateButtons(); RunBestAlgo(); } HistoryChart historyChart = tabHistory.Controls["historyChart"] as HistoryChart; if (historyChart != null) { historyChart.History = _engine.PriceHistories; historyChart.FlipLegend(); historyChart.UpdateChart(_engine.StatWindow); historyChart.Chart.DoubleClick += ChartOnDoubleClick; } }
private void InitHistoryChart() { HistoryChart preChart = tabHistory.Controls["historyChart"] as HistoryChart; if (preChart != null) { HistoryChart historyChart = new HistoryChart { Dock = DockStyle.Fill, History = _engine.PriceHistories }; historyChart.FlipLegend(); historyChart.UpdateChart(_engine.StatWindow, 3); historyChart.Chart.DoubleClick += ChartOnDoubleClick; tabHistory.Controls.Remove(preChart); tabHistory.Controls.Add(historyChart); } }