SaveConfigs() public static method

Saves the config file
public static SaveConfigs ( ) : void
return void
Exemplo n.º 1
0
        /// <summary>
        /// Change starting options
        /// </summary>
        void ChboxShow_CheckStateChanged(object sender, EventArgs e)
        {
            bShowTips = chboxShow.Checked;
            Configs.ShowStartingTip = bShowTips;
            Configs.SaveConfigs();

            return;
        }
Exemplo n.º 2
0
        /// <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;
        }
Exemplo n.º 3
0
        /// <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();
                }
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Change starting options
 /// </summary>
 private void ChboxShowCheckStateChanged(object sender, EventArgs e)
 {
     _showTips = ChboxShow.Checked;
     Configs.ShowStartingTip = _showTips;
     Configs.SaveConfigs();
 }