Exemplo n.º 1
0
        /// <summary>
        /// The default constructor
        /// </summary>
        private Actions()
        {
            StartPosition = FormStartPosition.CenterScreen;
            Size = new Size(785, 560);
            MinimumSize = new Size(600, 370);
            Icon = Data.Icon;
            Text = Data.ProgramName;
            FormClosing += ActionsFormClosing;
            Application.Idle += ApplicationIdle;

            // Load a data file
            LoadInstrument();

            // Prepare custom indicators
            UpdateSplashScreeStatus("Loading custom indicators...");
            if (Configs.LoadCustomIndicators)
                CustomIndicators.LoadCustomIndicators();

            // Load a strategy
            UpdateSplashScreeStatus("Loading strategy...");
            string strategyPath = Data.StrategyPath;
            if (Configs.LastStrategy != "" && (Configs.RememberLastStr || Data.ConnectionID > 0) )
            {
                string lastStrategy = Path.GetDirectoryName(Configs.LastStrategy);
                if (lastStrategy != "")
                    lastStrategy = Configs.LastStrategy;
                else
                {
                    string path = Path.Combine(Data.ProgramDir, Data.DefaultStrategyDir);
                    lastStrategy = Path.Combine(path, Configs.LastStrategy);
                }
                if (File.Exists(lastStrategy))
                    strategyPath = lastStrategy;
            }

            if (OpenStrategy(strategyPath) == 0)
            {
                CalculateStrategy(true);
                AfterStrategyOpening();
            }

            ChangeTabPage(Configs.LastTab);

            LiveContent.CheckForUpdate(Data.SystemDir, MILiveContent, MIForex, PnlUsefulLinks, PnlForexBrokers);

            // Starting tips
            if (Configs.ShowStartingTip)
            {
                var startingTips = new StartingTips();
                startingTips.Show();
            }

            UpdateSplashScreeStatus("Loading user interface...");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Opens the help window
        /// </summary>
        private void MenuHelpContentsOnClick(object sender, EventArgs e)
        {
            var mi = (ToolStripMenuItem)sender;

            if ((string)mi.Tag == "tips")
            {
                var shv = new StartingTips();
                shv.Show();
                return;
            }

            try
            {
                Process.Start((string)mi.Tag);
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception.Message);
            }
        }
        /// <summary>
        /// Does the job
        /// </summary>
        private void ExecuteCommand(string input)
        {
            if (input.StartsWith("help") || input.StartsWith("?"))
            {
                ShowHelp();
            }
            else if (input.StartsWith("clr"))
            {
                TbxOutput.Text = "";
            }
            else if (input.StartsWith("debug"))
            {
                TbxOutput.Text += "Debug mode - on" + Environment.NewLine;
                Data.Debug      = true;
            }
            else if (input.StartsWith("nodebug"))
            {
                TbxOutput.Text += "Debug mode - off" + Environment.NewLine;
                Data.Debug      = false;
            }
            else if (input.StartsWith("loadlang"))
            {
                Language.InitLanguages();
                TbxOutput.Text += "Language file loaded." + Environment.NewLine;
            }
            else if (input.StartsWith("importlang"))
            {
                Language.ImportLanguageFile(TbxOutput.Text);
            }
            else if (input.StartsWith("langtowiki"))
            {
                Language.ShowPhrases(4);
            }
            else if (input.StartsWith("genlangfiles"))
            {
                Language.GenerateLangFiles();
                TbxOutput.Text += "Language files generated." + Environment.NewLine;
            }
            else if (input.StartsWith("repairlang"))
            {
                TbxOutput.Text += "Language files repair" + Environment.NewLine +
                                  "---------------------" + Environment.NewLine + "";
                TbxOutput.Text += Language.RapairAllLangFiles();
            }
            else if (input.StartsWith("missingphrases"))
            {
                ShowMissingPhrases();
            }
            else if (input.StartsWith("speedtest"))
            {
                SpeedTest();
            }
            else if (input.StartsWith("str"))
            {
                ShowStrategy();
            }
            else if (input.StartsWith("bar"))
            {
                ShowBar(input);
            }
            else if (input.StartsWith("ind"))
            {
                ShowIndicators(input);
            }
            else if (input.StartsWith("reloadtips"))
            {
                var startingTips = new StartingTips();
                startingTips.Show();
            }
            else if (input.StartsWith("showalltips"))
            {
                var startingTips = new StartingTips {
                    ShowAllTips = true
                };
                startingTips.Show();
            }

            TbxOutput.Focus();
            TbxOutput.ScrollToCaret();

            TbxInput.Focus();
            TbxInput.Text = "";
        }
Exemplo n.º 4
0
        /// <summary>
        /// The default constructor
        /// </summary>
        private Actions()
        {
            StartPosition     = FormStartPosition.CenterScreen;
            Size              = new Size(785, 560);
            MinimumSize       = new Size(600, 370);
            Icon              = Data.Icon;
            Text              = Data.ProgramName;
            FormClosing      += ActionsFormClosing;
            Application.Idle += ApplicationIdle;

            // Load a data file
            LoadInstrument();

            // Prepare custom indicators
            UpdateSplashScreeStatus("Loading custom indicators...");
            if (Configs.LoadCustomIndicators)
            {
                CustomIndicators.LoadCustomIndicators();
            }

            // Load a strategy
            UpdateSplashScreeStatus("Loading strategy...");
            string strategyPath = Data.StrategyPath;

            if (Configs.LastStrategy != "" && (Configs.RememberLastStr || Data.ConnectionID > 0))
            {
                string lastStrategy = Path.GetDirectoryName(Configs.LastStrategy);
                if (lastStrategy != "")
                {
                    lastStrategy = Configs.LastStrategy;
                }
                else
                {
                    string path = Path.Combine(Data.ProgramDir, Data.DefaultStrategyDir);
                    lastStrategy = Path.Combine(path, Configs.LastStrategy);
                }
                if (File.Exists(lastStrategy))
                {
                    strategyPath = lastStrategy;
                }
            }

            if (OpenStrategy(strategyPath) == 0)
            {
                CalculateStrategy(true);
                AfterStrategyOpening();
            }

            ChangeTabPage(Configs.LastTab);

            LiveContent.CheckForUpdate(Data.SystemDir, MILiveContent, MIForex, PnlUsefulLinks, PnlForexBrokers);

            // Starting tips
            if (Configs.ShowStartingTip)
            {
                var startingTips = new StartingTips();
                startingTips.Show();
            }

            UpdateSplashScreeStatus("Loading user interface...");
        }
        /// <summary>
        /// Opens the help window
        /// </summary>
        private void MenuHelpContentsOnClick(object sender, EventArgs e)
        {
            var mi = (ToolStripMenuItem) sender;

            if ((string) mi.Tag == "tips")
            {
                var shv = new StartingTips();
                shv.Show();
                return;
            }

            try
            {
                Process.Start((string) mi.Tag);
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception.Message);
            }
        }
        /// <summary>
        /// Does the job
        /// </summary>
        private void ExecuteCommand(string input)
        {
            if (input.StartsWith("help") || input.StartsWith("?"))
            {
                ShowHelp();
            }
            else if (input.StartsWith("clr"))
            {
                TbxOutput.Text = "";
            }
            else if (input.StartsWith("debug"))
            {
                TbxOutput.Text += "Debug mode - on" + Environment.NewLine;
                Data.Debug = true;
            }
            else if (input.StartsWith("nodebug"))
            {
                TbxOutput.Text += "Debug mode - off" + Environment.NewLine;
                Data.Debug = false;
            }
            else if (input.StartsWith("loadlang"))
            {
                Language.InitLanguages();
                TbxOutput.Text += "Language file loaded." + Environment.NewLine;
            }
            else if (input.StartsWith("importlang"))
            {
                Language.ImportLanguageFile(TbxOutput.Text);
            }
            else if (input.StartsWith("langtowiki"))
            {
                Language.ShowPhrases(4);
            }
            else if (input.StartsWith("genlangfiles"))
            {
                Language.GenerateLangFiles();
                TbxOutput.Text += "Language files generated." + Environment.NewLine;
            }
            else if (input.StartsWith("repairlang"))
            {
                TbxOutput.Text += "Language files repair" + Environment.NewLine +
                                  "---------------------" + Environment.NewLine + "";
                TbxOutput.Text += Language.RapairAllLangFiles();
            }
            else if (input.StartsWith("missingphrases"))
            {
                ShowMissingPhrases();
            }
            else if (input.StartsWith("speedtest"))
            {
                SpeedTest();
            }
            else if (input.StartsWith("str"))
            {
                ShowStrategy();
            }
            else if (input.StartsWith("bar"))
            {
                ShowBar(input);
            }
            else if (input.StartsWith("ind"))
            {
                ShowIndicators(input);
            }
            else if (input.StartsWith("reloadtips"))
            {
                var startingTips = new StartingTips();
                startingTips.Show();
            }
            else if (input.StartsWith("showalltips"))
            {
                var startingTips = new StartingTips {ShowAllTips = true};
                startingTips.Show();
            }

            TbxOutput.Focus();
            TbxOutput.ScrollToCaret();

            TbxInput.Focus();
            TbxInput.Text = "";
        }