Esempio n. 1
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.UserFilesDir, Data.DefaultStrategyDir);
                        if (strategyPath == defaultPath)
                        {
                            Data.LoadedSavedStrategy = Path.GetFileName(Data.LoadedSavedStrategy);
                        }
                    }
                    Configs.LastStrategy = Data.LoadedSavedStrategy;
                }

                DeinitDataFeed();

                if (!Data.IsAutoStart)
                {
                    Configs.SaveConfigs();
                    Hide();
                    Data.SendStats();
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Change starting options
 /// </summary>
 private void ChboxShowCheckStateChanged(object sender, EventArgs e)
 {
     _showTips = ChboxShow.Checked;
     Configs.ShowStartingTip = _showTips;
     Configs.SaveConfigs();
 }