public static bool IsSolid(this ImageCellType ct) { return(ct == ImageCellType.BrownRock || ct == ImageCellType.BlueRock); }
/// <summary> /// 控制切换右侧详细信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _fpTunelInfo_SelectionChanged(object sender, SelectionChangedEventArgs e) { var rowIndex = 0; if (e != null) { rowIndex = e.Range.Row; } //巷道名称 _txtWorkingFaceName.Text = summaryCells[rowIndex, 0].Text; //日期班次 _txtPreWarningDateAndShift.Text = summaryCells[rowIndex, 1].Text + " " + summaryCells[rowIndex, 2].Text; try { //超限预警 _picOverLimitResult.Image = (Image)summaryCells[rowIndex, 3].Value; //突出预警 _picOurburstResult.Image = (Image)summaryCells[rowIndex, 4].Value; var imageCell = new ImageCellType(); imageCell.Style = RenderStyle.Normal; //Mark By QinKai,若添加新的预警依据项,需要更改的内容 var buttonCell = new ButtonCellType(); buttonCell.Text = "详细信息"; //超限预警 //瓦斯 infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.瓦斯, 1].CellType = imageCell; infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.瓦斯, 1].Value = summaryCells[rowIndex, _iOverLimitGas].Value; infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.瓦斯, 2].CellType = buttonCell; //煤层 infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.煤层赋存, 1].CellType = imageCell; infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.煤层赋存, 1].Value = summaryCells[rowIndex, _iOverLimitCoal].Value; infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.煤层赋存, 2].CellType = buttonCell; //地质 infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.地质构造, 1].CellType = imageCell; infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.地质构造, 1].Value = summaryCells[rowIndex, _iOverLimitGeology].Value; infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.地质构造, 2].CellType = buttonCell; //通风 infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.通风, 1].CellType = imageCell; infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.通风, 1].Value = summaryCells[rowIndex, _iOverLimitVentilation].Value; infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.通风, 2].CellType = buttonCell; //管理 infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.管理因素, 1].CellType = imageCell; infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.管理因素, 1].Value = summaryCells[rowIndex, _iOverLimitManagement].Value; infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.管理因素, 2].CellType = buttonCell; //其他 infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.其他, 1].CellType = imageCell; infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.其他, 1].Value = summaryCells[rowIndex, _iOverLimitOther].Value; infoCells[_iDetailsRowHeaderCount + (int)WarningReasonItems.其他, 2].CellType = buttonCell; //预警依据类型的数量 var warningItemTypeCount = Enum.GetNames(typeof(WarningReasonItems)).Length; //超限预警 //瓦斯 infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.瓦斯, 1].CellType = imageCell; infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.瓦斯, 1].Value = (summaryCells[rowIndex, _iOutBurstGas]).Value; infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.瓦斯, 2].CellType = buttonCell; //煤层 infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.煤层赋存, 1].CellType = imageCell; infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.煤层赋存, 1].Value = summaryCells[rowIndex, _iOutBurstCoal].Value; infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.煤层赋存, 2].CellType = buttonCell; //地质 infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.地质构造, 1].CellType = imageCell; infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.地质构造, 1].Value = summaryCells[rowIndex, _iOutBurstGeology].Value; infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.地质构造, 2].CellType = buttonCell; //通风 infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.通风, 1].CellType = imageCell; infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.通风, 1].Value = summaryCells[rowIndex, _iOutBurstVentilation].Value; infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.通风, 2].CellType = buttonCell; //管理 infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.管理因素, 1].CellType = imageCell; infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.管理因素, 1].Value = summaryCells[rowIndex, _iOutBurstManagement].Value; infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + (int)WarningReasonItems.管理因素, 2].CellType = buttonCell; //其他 infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + +(int)WarningReasonItems.其他, 1].CellType = imageCell; infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + +(int)WarningReasonItems.其他, 1].Value = summaryCells[rowIndex, _iOutBurstOther].Value; infoCells[warningItemTypeCount + 2 * _iDetailsRowHeaderCount + +(int)WarningReasonItems.其他, 2].CellType = buttonCell; } catch (Exception ex) { Alert.alert(ex.ToString()); } //设置传出值 //工作面名称 sOutWorkface = _txtWorkingFaceName.Text; //日期 sOutDate = summaryCells[rowIndex, 1].Text; //班次 sOutShift = summaryCells[rowIndex, 2].Text; //巷道ID sOutTunnelId = summaryCells[rowIndex, COLUMN_TUNNEL_ID].Text; }
public static ICellType CreateCellType(string CellType) { ICellType Result = null; switch (CellType.ToLower()) { case "文本": Result = new TextCellType(); break; case "数字": Result = new NumberCellType(); break; case "百分号": Result = new PercentCellType(); break; case "图片": Result = new ImageCellType(); break; case "超链接": Result = new HyperLinkCellType(); break; case "货币": Result = new CurrencyCellType(); break; case "日期时间": Result = new DateTimeCellType(); break; case "复选框": Result = new CheckBoxCellType(); break; case "上下标": Result = new RichTextCellType(); break; case "条形码": Result = new BarCodeCellType(); break; case "下拉框": Result = new DownListCellType(); break; case "掩码": Result = new MaskCellType(); break; case "删除线": Result = new DeleteLineCellType(); break; default: Result = new TextCellType(); break; } return(Result); }