/// <summary> /// Change starting options /// </summary> void ChboxShow_CheckStateChanged(object sender, EventArgs e) { bShowTips = chboxShow.Checked; Configs.ShowStartingTip = bShowTips; Configs.SaveConfigs(); return; }
/// <summary> /// Menu Multiple Instances Changed /// </summary> protected override void MenuMultipleInstances_OnClick(object sender, EventArgs e) { Configs.MultipleInstances = ((ToolStripMenuItem)sender).Checked; if (Configs.MultipleInstances) { Configs.SaveConfigs(); Disconnect(); DeinitDataFeed(); tsTradeControl.SuspendLayout(); tsbtnChangeID.Visible = false; tslblConnection.Visible = false; tsbtnTrading.Visible = false; tslblConnectionID.Visible = true; tstbxConnectionID.Visible = true; tsbtnConnectionGo.Visible = true; tsTradeControl.ResumeLayout(); } else { Configs.SaveConfigs(); Disconnect(); DeinitDataFeed(); Data.ConnectionID = 0; tsTradeControl.SuspendLayout(); tsbtnChangeID.Visible = false; tslblConnection.Visible = true; tsbtnTrading.Visible = true; tslblConnectionID.Visible = false; tstbxConnectionID.Visible = false; tsbtnConnectionGo.Visible = false; tsTradeControl.ResumeLayout(); InitDataFeed(); } symbolReconnect = ""; return; }
/// <summary> /// Checks whether the strategy have been saved or not /// </summary> private void ActionsFormClosing(object sender, FormClosingEventArgs e) { DialogResult dialogResult = WhetherSaveChangedStrategy(); if (dialogResult == DialogResult.Yes) { SaveStrategy(); } else if (dialogResult == DialogResult.Cancel) { e.Cancel = true; } if (!e.Cancel) { // Remember the last used strategy if (Configs.RememberLastStr) { if (Data.LoadedSavedStrategy != "") { string strategyPath = Path.GetDirectoryName(Data.LoadedSavedStrategy) + "\\"; string defaultPath = Path.Combine(Data.ProgramDir, Data.DefaultStrategyDir); if (strategyPath == defaultPath) { Data.LoadedSavedStrategy = Path.GetFileName(Data.LoadedSavedStrategy); } } Configs.LastStrategy = Data.LoadedSavedStrategy; } DeinitDataFeed(); if (!Data.IsAutoStart) { Configs.SaveConfigs(); Hide(); Data.SendStats(); } } }
/// <summary> /// Change starting options /// </summary> private void ChboxShowCheckStateChanged(object sender, EventArgs e) { _showTips = ChboxShow.Checked; Configs.ShowStartingTip = _showTips; Configs.SaveConfigs(); }