Forex_Strategy_Builder.Actions.OpenFile C# (CSharp) Method

OpenFile() private method

Open a strategy file
private OpenFile ( ) : void
return void
        void OpenFile()
        {
            DialogResult dialogResult = WhetherSaveChangedStrategy();

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

            OpenFileDialog opendlg = new OpenFileDialog();

            opendlg.InitialDirectory = Data.StrategyDir;
            opendlg.Filter = Language.T("Strategy file") + " (*.xml)|*.xml";
            opendlg.Title  = Language.T("Open Strategy");

            if (opendlg.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    OpenStrategy(opendlg.FileName);
                    AfterStrategyOpening(true);
                    Calculate(false);
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.Message, Text);
                    return;
                }
            }

            return;
        }
Actions