Ejemplo n.º 1
0
        /// <summary>
        /// Checks whether the strategy have been saved or not
        /// </summary>
        void Actions_FormClosing(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();
                Configs.SaveConfigs();
                this.Hide();
                Data.SendStats();
            }

            return;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Change starting options
 /// </summary>
 private void ChboxShowCheckStateChanged(object sender, EventArgs e)
 {
     _showTips = ChboxShow.Checked;
     Configs.ShowStartingTip = _showTips;
     Configs.SaveConfigs();
 }