Esempio n. 1
0
        protected override void OnLoad(EventArgs e)
        {
            this.Text = this.TabText = Global.Languages["Symbols Window"]["Symbols"];

            LanguageManager.PhraseGroup pgroup = Global.Languages["Trader"];

            _dgvColSymbolName.HeaderText = pgroup["Symbol"];
            _dgvColBid.HeaderText        = pgroup["Bid"];
            _dgvColAsk.HeaderText        = pgroup["Ask"];

            Global.MainForm.TablesManager.InitializeDataGridView(_dataGridView);

            this.UpdateTable();

            base.OnLoad(e);
        }
        private void SaveValues()
        {
            if (_table.Rows.Count == 0)
            {
                return;
            }
            bool changed = false;

            LanguageManager.PhraseGroup pgroup = null;
            foreach (DataRow row in _table.Rows)
            {
                string code        = (string)row["lang"];
                string group       = (string)row["group"];
                string phraseName  = (string)row["phrase_name"];
                string phraseValue = (string)row["phrase_value"];

                if (!code.Equals(_appItem.Language.Code))
                {
                    return;
                }
                if (pgroup == null)
                {
                    pgroup = _appItem.Language[group];
                }


                string oldPhraseValue = pgroup[phraseName];
                if (!phraseValue.Equals(oldPhraseValue))
                {
                    changed = true;
                }

                pgroup.SetPhrase(phraseName, phraseValue);
            }
            if (changed)
            {
                _appItem.Language.Save();
            }
        }
Esempio n. 3
0
        private void worker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            this.SetProgressText("Loading Properties...");
            try {
                Global.Properties = new EasyProperties();
                Global.Properties.Load(Global.Setup.AppConfigFile);
            } catch { }

            this.SetProgressText("Initialize Languages...");
            Global.Languages = new LanguageManager(Global.Setup.LanguagesDirectory, "Gordago.FO");
            Global.Languages.Select(Global.Properties.GetValue <string>("Language", "en-US"));

            _phrase = Global.Languages["SplashForm"];
            this.SetProgressText(_phrase.Phrase("LoadQuotes", "Loading quotes..."));
            Global.Quotes = new Gordago.FO.Quotes.QuotesManager();

            this.SetProgressText(_phrase.Phrase("LoadIndicators", "Loading indicators..."));
            Global.Indicators = new Gordago.FO.Instruments.IndicatorsManager();

            this.SetProgressText(_phrase.Phrase("InitCompiler", "Initialization of the compiler..."));
            Global.Projects = new Gordago.FO.Instruments.ProjectsManager();
            Global.Projects.LoadReferencedAssembly += new Gordago.FO.Instruments.ProjectsManager.LoadReferencedAssembliesEventHandler(Projects_LoadReferencedAssembly);
            Global.Projects.Load();
        }
        private void UpdateTable()
        {
            if (this._lstGroup.SelectedItems.Count != 1)
            {
                return;
            }
            this.SaveValues();

            LanguageManager.PhraseGroup group = (this._lstGroup.SelectedItems[0] as PhraseGroupItem).PhraseGroup;
            _table.Rows.Clear();

            int nn = 1;

            foreach (LanguageManager.Phrase phrase in group.GetPhrases())
            {
                DataRow row = _table.NewRow();
                row["nn"]           = nn++;
                row["lang"]         = _appItem.Language.Code;
                row["group"]        = group.Name;
                row["phrase_name"]  = phrase.Name;
                row["phrase_value"] = phrase.Value;
                _table.Rows.Add(row);
            }
        }
 public PhraseGroupItem(LanguageManager.PhraseGroup group)
     : base(group.Name)
 {
     _group = group;
 }