Esempio n. 1
0
        internal void UpdateData(DataSetLanguage ds)
        {
            if (true == this.readOnly)
            {
                return;
            }

            try
            {
                this.oleDbDataAdapterTexts.Update(ds.Texts);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                this.readOnly = true;
            }
        }
Esempio n. 2
0
        private void FormTextsEditor_Load(object sender, System.EventArgs e)
        {
            this.dsLang = I18N.Instance.GetData();

            DataTable dt = new DataTable();
            this.dsTexts.Tables.Add(dt);

            dt.Columns.Add("SrcText", typeof(string));

            foreach (DataSetLanguage.LanguagesRow dr1 in this.dsLang.Languages.Rows)
            {
                if (false == this.dsTexts.Tables[0].Columns.Contains("L" + dr1.id))
                {
                    this.dsTexts.Tables[0].Columns.Add("L" + dr1.id, typeof(string));
                }
            }

            foreach (DataSetLanguage.TextsRow dr in dsLang.Texts.Rows)
            {
                AddText(dr.Language, dr.SrcText, dr.Translation);
            }

            this.dsTexts.AcceptChanges();

            foreach (DataSetLanguage.LanguagesRow dr1 in this.dsLang.Languages.Rows)
            {
                DataGridTextBoxColumn ds = new DataGridTextBoxColumn();
                ds.MappingName = "L" + dr1.id;
                ds.HeaderText = dr1.Name;

                this.dataGridTableStyle1.GridColumnStyles.Add(ds);
            }

            this.dataGridTableStyle1.MappingName = this.dsTexts.Tables[0].TableName;

            this.dataView.Table = this.dsTexts.Tables[0];
        }
Esempio n. 3
0
        internal DataSetLanguage GetData()
        {
            DataSetLanguage ds = new DataSetLanguage();

            try
            {
                this.oleDbDataAdapterLanguages.Fill(ds.Languages);
                this.oleDbDataAdapterTexts.Fill(ds.Texts);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                this.hasLanguages = false;
            }

            return ds;
        }