public BaseCellConfigForm(ICell cell, BaseCellConfig cellConfig) { InitializeComponent(); _cell = cell; _cellConfig = cellConfig; if (cellConfig.PrimConfigList.Count < 0) { return; } foreach (SingleCellPrimConfig item in cellConfig.PrimConfigList) { int index = this.dtgvPrim.Rows.Add(); this.dtgvPrim.Rows[index].Cells[0].Value = item.PrimName; this.dtgvPrim.Rows[index].Cells[1].Value = item.PrimGuid; this.dtgvPrim.Rows[index].Cells[2].Value = item.OutputUIDis; this.dtgvPrim.Rows[index].Cells[3].Value = item.ConfigUIDis; this.dtgvPrim.Rows[index].Cells[4].Value = item.DebugUIDis; if (item.TabType == TabDisMode.Default) { this.dtgvPrim.Rows[index].Cells[5].Value = ""; } else if (item.TabType == TabDisMode.SingleTab) { this.dtgvPrim.Rows[index].Cells[5].Value = "SingleTab"; } else if (item.TabType == TabDisMode.MultiTab) { this.dtgvPrim.Rows[index].Cells[5].Value = "MultiTab"; } this.dtgvPrim.Rows[index].Cells[6].Value = item.TabIndex; this.dtgvPrim.Rows[index].Cells[7].Value = item.ControlIndex; } //SingleCellPrimConfig model = new SingleCellPrimConfig(); //foreach (var p in model.GetType().GetProperties()) //{ // _primDtSrc.Columns.Add(p.Name, p.GetType()); //} //for (int i = 0; i < dr.Table.Columns.Count; i++) //{ //PropertyInfo propertyInfo = model.GetType().GetProperty(dr.Table.Columns[i].ColumnName); //if (propertyInfo != null && dr[i] != DBNull.Value) //propertyInfo.SetValue(model, dr[i], null); //} //dtgvPrim.DataSource = _primDtSrc; }
public int ICellImportConfigXml(XmlNode xmlNode) { int iRet = 0; if (xmlNode != null) { CellConfig = XMLHelper.XMLToObject(xmlNode, typeof(BaseCellConfig)) as BaseCellConfig; } else { return(-1); } return(iRet); }
public BaseCell(XmlNode xmlNode) { if (xmlNode != null) { CellConfig = XMLHelper.XMLToObject(xmlNode, typeof(BaseCellConfig)) as BaseCellConfig; } else { return; } //CellName = "Default"; //CellID = Guid.NewGuid(); _cellOutputForm = new BaseCellOutputForm((ICell)this); _cellConfigForm = new BaseCellConfigForm((ICell)this, CellConfig); //_cellConfig.PrimConfigList = new List<SingleCellPrimConfig>(); }