Forex_Strategy_Builder.Actions.Actions_FormClosing C# (CSharp) Method

Actions_FormClosing() private method

Checks whether the strategy have been saved or not
private Actions_FormClosing ( object sender, FormClosingEventArgs e ) : void
sender object
e System.Windows.Forms.FormClosingEventArgs
return void
        void Actions_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult dialogResult = WhetherSaveChangedStrategy();

            if (dialogResult == DialogResult.Yes)
                SaveStrategy();
            else if (dialogResult == DialogResult.Cancel)
                e.Cancel = true;

            // Remember the last used strategy
            if (Configs.RememberLastStr)
            {
                if (Data.LoadedSavedStrategy != "")
                {
                    string strategyPath = Path.GetDirectoryName(Data.LoadedSavedStrategy) + Path.DirectorySeparatorChar;
                    string defaultPath  = Path.Combine(Data.ProgramDir, Data.DefaultStrategyDir);
                    if (strategyPath == defaultPath)
                        Data.LoadedSavedStrategy = Path.GetFileName(Data.LoadedSavedStrategy);
                }
                Configs.LastStrategy = Data.LoadedSavedStrategy;
            }

            Configs.SaveConfigs();
            Instruments.SaveInstruments();

            return;
        }
Actions