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); } } }
private void formStringLibrary_Load(object sender, EventArgs e) { this.isLoading = true; this.needtoClose = true; base.Size = new System.Drawing.Size(480, 390); if (Program.IsforeignTradeMode) { base.Icon = Resources.AppIconV5; } else { base.Icon = Resources.AppIcon; } this.pnlUSB.Visible = false; this.cmbFontName.Items.Clear(); IList <string> fontFamilies = new FontFamiliesEx().GetFontFamilies(); if (fontFamilies != null && fontFamilies.Count > 0) { using (IEnumerator <string> enumerator = fontFamilies.GetEnumerator()) { while (enumerator.MoveNext()) { string current = enumerator.Current; this.cmbFontName.Items.Add(current); } goto IL_F6; } } string[] fontNames = LedCommonConst.FontNames; for (int i = 0; i < fontNames.Length; i++) { this.cmbFontName.Items.Add(fontNames[i]); this.cmbFontName.Items.Add("@" + fontNames[i]); } IL_F6: this.cmbEncoding.Items.Clear(); foreach (int num in Enum.GetValues(typeof(LedStringEncoding))) { string name = Enum.GetName(typeof(LedStringEncoding), num); this.cmbEncoding.Items.Add(name); } if (this.stringLibrary != null) { this.nudWidth.Value = this.stringLibrary.Width; } else { this.nudWidth.Value = 16m; } if (this.stringLibrary != null) { this.nudHeight.Value = this.stringLibrary.Height; } else { this.nudHeight.Value = 16m; } if (this.stringLibrary != null) { this.lblVerticalStretchOffset.Text = this.stringLibrary.VerticalStretch.ToString("D3"); } else { this.lblVerticalStretchOffset.Text = "000"; } if (this.cmbFontName.Items.Count > 0) { if (this.stringLibrary != null && !string.IsNullOrEmpty(this.stringLibrary.Font.FamilyName)) { int selectedIndex = 0; for (int j = 0; j < this.cmbFontName.Items.Count; j++) { if (this.cmbFontName.Items[j].ToString() == this.stringLibrary.Font.FamilyName) { selectedIndex = j; break; } } this.cmbFontName.SelectedIndex = selectedIndex; } else { this.cmbFontName.SelectedIndex = 0; } } if (this.cmbFontSize.Items.Count > 0) { if (this.stringLibrary != null) { this.cmbFontSize.Text = this.stringLibrary.Font.Size.ToString(); } else { this.cmbFontSize.SelectedIndex = 0; } } if (this.cmbEncoding.Items.Count > 0) { if (this.stringLibrary != null) { this.cmbEncoding.Text = this.stringLibrary.StringEncoding.ToString(); } else { this.cmbEncoding.SelectedIndex = 0; } } if (this.stringLibrary != null) { this.lblZoom.Text = this.stringLibrary.Zoom.ToString(); } else { this.lblZoom.Text = "1.0"; } this.PreviewDraw(); this.isLoading = false; }