Exemple #1
0
 private void InitControl()
 {
     if (!this.isFontDone)
     {
         this.cmbFontName.Items.Clear();
         IList <string> fontFamilies = new FontFamiliesEx().GetFontFamilies();
         if (fontFamilies != null && fontFamilies.Count > 0)
         {
             foreach (string current in fontFamilies)
             {
                 this.cmbFontName.Items.Add(current);
             }
         }
         this.isFontDone = true;
     }
     this.cmbColor.Items.Clear();
     if (this.mar_Text != null && this.panel != null)
     {
         IList <System.Drawing.Color> colorList = LedColorConst.GetColorList(this.panel.ColorMode);
         foreach (System.Drawing.Color current2 in colorList)
         {
             this.cmbColor.Items.Add(current2);
         }
     }
     this.cmbBackColor.Items.Clear();
     if (this.panel != null)
     {
         IList <System.Drawing.Color> backColorList = LedColorConst.GetBackColorList(this.panel.ColorMode);
         foreach (System.Drawing.Color current3 in backColorList)
         {
             this.cmbBackColor.Items.Add(current3);
         }
     }
 }
Exemple #2
0
        private void formStringTest_Load(object sender, EventArgs e)
        {
            if (Program.IsforeignTradeMode)
            {
                base.Icon = Resources.AppIconV5;
            }
            else
            {
                base.Icon = Resources.AppIcon;
            }
            this.cmbEncoding.Enabled = false;
            this.cmbEncoding.Items.Clear();
            foreach (int num in Enum.GetValues(typeof(LedStringEncoding)))
            {
                string name = Enum.GetName(typeof(LedStringEncoding), num);
                this.cmbEncoding.Items.Add(name);
            }
            this.cmbDisplayWay.Items.Clear();
            List <string> list      = MulitLanguageFresher.Language_Control_List["formStringTest_ComboBox_DisplayWay"];
            DataTable     dataTable = new DataTable();
            DataColumn    column    = new DataColumn("ID");

            dataTable.Columns.Add(column);
            column = new DataColumn("Name");
            dataTable.Columns.Add(column);
            foreach (int num2 in Enum.GetValues(typeof(LedStringDisplayWay)))
            {
                DataRow dataRow = dataTable.NewRow();
                dataRow[0] = num2;
                if (num2 == 0)
                {
                    dataRow[1] = list[0];
                }
                else
                {
                    dataRow[1] = list[1];
                }
                dataTable.Rows.Add(dataRow);
            }
            this.cmbDisplayWay.DisplayMember = "Name";
            this.cmbDisplayWay.ValueMember   = "ID";
            this.cmbDisplayWay.DataSource    = dataTable;
            this.cmbColor.Items.Clear();
            if (this.panel != null)
            {
                IList <System.Drawing.Color> colorList = LedColorConst.GetColorList(this.panel.ColorMode);
                foreach (System.Drawing.Color current in colorList)
                {
                    this.cmbColor.Items.Add(current);
                }
            }
            this.cmbDeleteType.Items.Clear();
            List <string> list2 = MulitLanguageFresher.Language_Control_List["formStringTest_ComboBox_DeleteType"];

            dataTable = new DataTable();
            column    = new DataColumn("ID");
            dataTable.Columns.Add(column);
            column = new DataColumn("Name");
            dataTable.Columns.Add(column);
            DataRow dataRow2 = dataTable.NewRow();

            dataRow2[0] = 0;
            dataRow2[1] = list2[0];
            dataTable.Rows.Add(dataRow2);
            dataRow2    = dataTable.NewRow();
            dataRow2[0] = 2;
            dataRow2[1] = list2[1];
            dataTable.Rows.Add(dataRow2);
            this.cmbDeleteType.DisplayMember = "Name";
            this.cmbDeleteType.ValueMember   = "ID";
            this.cmbDeleteType.DataSource    = dataTable;
            if (this.stringContent != null && this.stringUpdate != null)
            {
                this.stringUpdate.ID = this.stringContent.ID;
            }
            if (this.cmbEncoding.Items.Count > 0)
            {
                if (this.stringContent != null)
                {
                    this.cmbEncoding.Text = this.stringContent.StringEncoding.ToString();
                    if (this.stringUpdate != null)
                    {
                        this.stringUpdate.StringEncoding = this.stringContent.StringEncoding;
                    }
                }
                else
                {
                    this.cmbEncoding.SelectedIndex = 1;
                }
            }
            if (this.cmbDisplayWay.Items.Count > 0)
            {
                this.cmbDisplayWay.SelectedIndex = 0;
            }
            if (this.stringContent != null)
            {
                this.txtIndex.Text     = "0";
                this.lblIndexHint.Text = "(0-" + (this.stringContent.NumberCount - 1) + ")";
            }
            if (this.cmbColor.Items.Count > 0)
            {
                this.cmbColor.SelectedIndex = 0;
            }
            this.txtContent.Text = string.Empty;
            if (this.stringContent != null)
            {
                this.txtContent.MaxLength = this.stringContent.EachNumber;
                this.lblContentHint.Text  = string.Format("{0}/{1}", this.txtContent.TextLength, this.stringContent.EachNumber);
            }
            if (this.cmbDeleteType.Items.Count > 0)
            {
                this.cmbDeleteType.SelectedIndex = 0;
            }
            if (this.stringContent != null)
            {
                this.txtDeleteIndex.Text     = "0";
                this.lblDeleteIndexHint.Text = string.Format(formMain.ML.GetStr("formStringTest_Label_DeleteIndexHint"), this.stringContent.NumberCount - 1);
            }
        }