コード例 #1
0
ファイル: BaseCell.cs プロジェクト: xusongfei/LeadChina
        public int ICellAddPrim(string primName, Guid primId)
        {
            if (CellConfig == null)
            {
                return(-1);
            }

            if (CellConfig.PrimConfigList == null)
            {
                return(-1);
            }

            foreach (SingleCellPrimConfig item in CellConfig.PrimConfigList)
            {
                if (item.PrimGuid == primId)
                {
                    return(-1);
                }
            }

            SingleCellPrimConfig sConfig = new SingleCellPrimConfig();

            sConfig.PrimName     = primName;
            sConfig.PrimGuid     = primId;
            sConfig.TabType      = TabDisMode.Default;
            sConfig.ControlIndex = 0;
            sConfig.TabIndex     = 0;

            CellConfig.PrimConfigList.Add(sConfig);

            return(0);
        }
コード例 #2
0
        private void tStripLbApplicate_Click(object sender, EventArgs e)
        {
            if (_cell == null)
            {
                return;
            }

            _cellConfig.PrimConfigList.Clear();

            foreach (DataGridViewRow row in dtgvPrim.Rows)
            {
                if (row.Cells[0].Value == null)
                {
                    continue;
                }
                if (row.Cells[1].Value == null)
                {
                    continue;
                }

                SingleCellPrimConfig config = new SingleCellPrimConfig();
                config.PrimName    = (string)row.Cells[0].Value;
                config.PrimGuid    = (Guid)row.Cells[1].Value;
                config.OutputUIDis = (Boolean)row.Cells[2].Value;
                config.ConfigUIDis = (Boolean)row.Cells[3].Value;
                config.DebugUIDis  = (Boolean)row.Cells[4].Value;
                if (row.Cells[5].Value == null)
                {
                    config.TabType = TabDisMode.Default;
                }
                else if (row.Cells[5].Value.ToString() == "SingleTab")
                {
                    config.TabType = TabDisMode.SingleTab;
                }
                else if (row.Cells[5].Value.ToString() == "MultiTab")
                {
                    config.TabType = TabDisMode.MultiTab;
                }

                int tabIndex     = -1;
                int controlIndex = -1;
                if (row.Cells[6].Value != null)
                {
                    int.TryParse(row.Cells[6].Value.ToString(), out tabIndex);
                }
                if (row.Cells[7].Value != null)
                {
                    int.TryParse(row.Cells[7].Value.ToString(), out controlIndex);
                }

                config.TabIndex     = tabIndex;
                config.ControlIndex = controlIndex;

                _cellConfig.PrimConfigList.Add(config);
            }
        }