private void InitBarcodeTemplete() { List <string> configNames = new PLBarCode().GetConfigNames(); if (configNames != null) { for (int i = 0; i < configNames.Count; i++) { this.cmbTemplate.Items.Add(configNames[i]); } } }
public DlgBarcode(string xml, string className, bool readOnly) { this.InitializeComponent(); ArrayList attris = new ArrayList(ModelContext.MetaModel.GetAllAttributes(className)); this.FilterAttributes(attris); if ((attris != null) && (attris.Count > 0)) { this.cmbAttrList.DataSource = attris; this.cmbAttrList.ValueMember = "Name"; this.cmbAttrList.DisplayMember = "Label"; } List <string> configNames = new PLBarCode().GetConfigNames(); for (int i = 0; i < configNames.Count; i++) { this.cmbTemplate.Items.Add(configNames[i]); } if (PPCardCompiler.ExplainInterPicXml(xml, this.info)) { this.cmbAttrList.SelectedValue = this.info.AttrName; if (this.cmbTemplate.Items.Contains(this.info.TemplateName)) { this.cmbTemplate.Text = this.info.TemplateName; } this.txtCellStart.Text = this.info.CellStart; this.txtCellEnd.Text = this.info.CellEnd; } else { this.cmbAttrList.SelectedIndex = 0; if (this.cmbTemplate.Items.Count > 0) { this.cmbTemplate.SelectedIndex = 0; } else { MessageBox.Show("还未定义条码模板,请先定义条码模板。", "工艺", MessageBoxButtons.OK); } } if (readOnly) { this.panel1.Enabled = false; this.btnOk.Visible = false; this.btnCancel.Text = "确定"; } }