Пример #1
0
        public CellConfigForm(ICell cell, CellConfigs cellConfigs)
        {
            InitializeComponent();
            _cell        = cell;
            _cellConfigs = cellConfigs;

            if (cellConfigs.PrimConfigList.Count < 0)
            {
                return;
            }

            foreach (CellConfig item in cellConfigs.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;
            }

            //CellConfigs model = new CellConfigs();
            //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;
        }
Пример #2
0
        public int ImportConfig(XmlNode xmlNode)
        {
            var iRet = 0;

            if (xmlNode != null)
            {
                CellConfigs = XMLHelper.XMLToObject(xmlNode, typeof(CellConfigs)) as CellConfigs;
            }
            else
            {
                return(-1);
            }

            return(iRet);
        }
Пример #3
0
        public Cell(XmlNode xmlNode)
        {
            if (xmlNode != null)
            {
                CellConfigs = XMLHelper.XMLToObject(xmlNode, typeof(CellConfigs)) as CellConfigs;
            }
            else
            {
                return;
            }

            CellID   = Guid.NewGuid();
            CellName = "Default";

            _cellOutputForm = new CellOutputForm(this);
            _cellConfigForm = new CellConfigForm(this, CellConfigs);
        }