public int AddPrim(string primName, Guid primId) { if (CellConfigs == null) { return(-1); } if (CellConfigs.PrimConfigList == null) { return(-1); } foreach (var item in CellConfigs.PrimConfigList) { if (item.PrimGuid == primId) { return(-1); } } var sConfig = new CellConfig(); sConfig.PrimName = primName; sConfig.PrimGuid = primId; sConfig.TabType = TabDisMode.Default; sConfig.ControlIndex = 0; sConfig.TabIndex = 0; CellConfigs.PrimConfigList.Add(sConfig); return(0); }
private void tStripLbApplicate_Click(object sender, EventArgs e) { if (_cell == null) { return; } _cellConfigs.PrimConfigList.Clear(); foreach (DataGridViewRow row in dtgvPrim.Rows) { if (row.Cells[0].Value == null) { continue; } if (row.Cells[1].Value == null) { continue; } CellConfig config = new CellConfig(); 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; _cellConfigs.PrimConfigList.Add(config); } }