InitLanguages() public static method

Inits the languages.
public static InitLanguages ( ) : void
return void
        /// <summary>
        /// Sets the program's language.
        /// </summary>
        protected override void Language_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem mi = (ToolStripMenuItem)sender;

            if (!mi.Checked)
            {
                Configs.Language = mi.Name;
                Language.InitLanguages();

                MainMenuStrip.Items.Clear();
                InitializeMenu();

                statusStrip.Items.Clear();
                InitializeStatusBar();

                Calculate(false);
                RebuildStrategyLayout();
                infpnlMarketStatistics.Update(Data.MarketStatsParam, Data.MarketStatsValue, Data.MarketStatsFlag, Language.T("Market Statistics"));
                SetupJournal();
                pnlWorkspace.Invalidate(true);
                string messageText = Language.T("Restart the program to activate the changes!");
                MessageBox.Show(messageText, Language.T("Language Change"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            foreach (ToolStripMenuItem tsmi in mi.Owner.Items)
            {
                tsmi.Checked = false;
            }
            mi.Checked = true;

            return;
        }
        /// <summary>
        /// Button click
        /// </summary>
        private void BtnClick(object sender, EventArgs e)
        {
            var    button     = (Button)sender;
            string buttonName = button.Name;

            if (buttonName == "Search")
            {
                SearchPhrase(TbxSearch.Text);
            }

            if (buttonName == "Untranslated")
            {
                SearchUntranslatedPhrase();
            }

            if (buttonName == "Accept")
            {
                SaveTranslation();
                Language.InitLanguages();

                Close();
            }

            if (buttonName == "Cancel")
            {
                Close();
            }
        }
        /// <summary>
        /// Button click
        /// </summary>
        void Btn_Click(object sender, EventArgs e)
        {
            Button button     = (Button)sender;
            string buttonName = button.Name;

            if (buttonName == "Search")
            {
                SearchPhrase(tbxSearch.Text);
            }

            if (buttonName == "Untranslated")
            {
                SearchUntranslatedPhrase();
            }

            if (buttonName == "Accept")
            {
                SaveTranslation();
                Language.InitLanguages();

                this.Close();
            }

            if (buttonName == "Cancel")
            {
                this.Close();
            }

            return;
        }
示例#4
0
        public static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            UpdateStatusLabel("Loading...");
            Data.Start();
            Instruments.LoadInstruments();
            Configs.LoadConfigs();
            Language.InitLanguages();
            LayoutColors.InitColorSchemes();
            Data.InitMarketStatistic();

            Data.InstrProperties = Instruments.InstrumentList[Data.Strategy.Symbol].Clone();

            Application.Run(new Actions());

            return;
        }
        /// <summary>
        /// Does the job
        /// </summary>
        private void ParseInput(string input)
        {
            var asCommands = new[]
            {
                "help           - Shows the commands list.",
                "clr            - Clears the screen.",
                "pos #          - Shows the parameters of position #.",
                "ord #          - Shows the parameters of order #.",
                "bar #          - Shows the prices of bar #.",
                "ind #          - Shows the indicators for bar #.",
                "str            - shows the strategy.",
                "debug          - Turns on debug mode.",
                "undebug        - Turns off debug mode.",
                "loadlang       - Reloads the language file.",
                "missingphrases - Shows all phrases, which are used in the program but are not included in the language file.",
                "genlangfiles   - Regenerates English.xml.",
                "repairlang     - Repairs all the language files.",
                "importlang     - Imports a translation (Read more first).",
                "langtowiki     - Shows translation in wiki format.",
                "resetinstrum   - Resets the instruments list.",
                "speedtest      - Performs a speed test.",
                "reloadtips     - Reloads the starting tips.",
                "showalltips    - Shows all the starting tips."
            };

            if (input.StartsWith("help") || input.StartsWith("?"))
            {
                TbxOutput.Text = "Commands" + Environment.NewLine + "-----------------" + Environment.NewLine;
                foreach (string sCommand in asCommands)
                {
                    TbxOutput.Text += sCommand + Environment.NewLine;
                }
            }
            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("resetinstrum"))
            {
                Instruments.ResetInstruments();
                TbxOutput.Text += "The instruments are reset." + Environment.NewLine + "Restart the program now!" +
                                  Environment.NewLine;
            }
            else if (input.StartsWith("missingphrases"))
            {
                ShowMissingPhrases();
            }
            else if (input.StartsWith("speedtest"))
            {
                SpeedTest();
            }
            else if (input.StartsWith("str"))
            {
                ShowStrategy();
            }
            else if (input.StartsWith("pos"))
            {
                ShowPosition(input);
            }
            else if (input.StartsWith("ord"))
            {
                ShowOrder(input);
            }
            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 = "";
        }