public void OnPrinterPropertyChanged(SPrinterProperty property) { _property = property; for (int i = 0; i < mainButtons.Count; i++) { if (i < 2) { if (property.nWhiteInkNum > 0 && i < property.nWhiteInkNum) { clolorsLabels[i].Text = string.Format("{0}({1})", property.Get_ColorIndex(i + property.nColorNum - property.nWhiteInkNum), i + 1); } else { clolorsLabels[i].Text = string.Empty; pumpButtons[i].Visible = clolorsLabels[i].Visible = mainButtons[i].Visible = reservoirsButtons[i].Visible = false; } } else { if (i - 2 < property.nColorNum - property.nWhiteInkNum) { clolorsLabels[i].Text = string.Format("{0}({1})", property.Get_ColorIndex(i - 2), i + 1); } else { clolorsLabels[i].Text = string.Empty; pumpButtons[i].Visible = clolorsLabels[i].Visible = mainButtons[i].Visible = reservoirsButtons[i].Visible = false; } } } }
public void OnPrinterPropertyChanged(SPrinterProperty property) { _property = property; for (int i = 0; i < this.colorLabels.Count; i++) { if (i < property.nColorNum) { colorLabels[i].Text = string.Format("{0}({1})", property.Get_ColorIndex(i), property.nColorNum - i); colorFlags[i].BackColor = GetBackColorByIndex(i); } else { colorFlags[i].Visible = tempInputs[i].Visible = colorLabels[i].Visible = false; } #if false if (i < 2) { if (property.nWhiteInkNum > 0 && i < property.nWhiteInkNum) { colorLabels[i].Text = string.Format("{0}({1})", property.Get_ColorIndex(i + property.nColorNum - property.nWhiteInkNum), i + 1); colorFlags[i].BackColor = GetBackColorByIndex(i + property.nColorNum - property.nWhiteInkNum); } else { colorFlags[i].Visible = tempInputs[i].Visible = colorLabels[i].Visible = false; } } else { if (i - 2 < property.nColorNum - property.nWhiteInkNum) { colorLabels[i].Text = string.Format("{0}({1})", property.Get_ColorIndex(i - 2), i + 1); colorFlags[i].BackColor = GetBackColorByIndex(i - 2); } else { colorFlags[i].Visible = tempInputs[i].Visible = colorLabels[i].Visible = false; } } #endif } LoadData(); }
public void OnPrinterPropertyChanged(SPrinterProperty property) { _property = property; for (int i = 0; i < mainButtons.Count; i++) { if (i < property.nColorNum) { clolorsLabels[i].Text = string.Format("{0}({1})", property.Get_ColorIndex(property.nColorNum - (1 + i)), i + 1);//约定从右往左显示,与校准向导相反 } else { clolorsLabels[i].Text = string.Empty; pumtTimeoutButtons[i].Visible = purgeButtons[i].Visible = tempTextBoxs[i].Visible = pumpButtons[i].Visible = clolorsLabels[i].Visible = mainButtons[i].Visible = reservoirsButtons[i].Visible = false; } #if false if (i < 2) { if (property.nWhiteInkNum > 0 && i < property.nWhiteInkNum) { clolorsLabels[i].Text = property.Get_ColorIndex(i + property.nColorNum - property.nWhiteInkNum); } else { clolorsLabels[i].Text = string.Empty; pumtTimeoutButtons[i].Visible = purgeButtons[i].Visible = tempTextBoxs[i].Visible = pumpButtons[i].Visible = clolorsLabels[i].Visible = mainButtons[i].Visible = reservoirsButtons[i].Visible = false; } } else { if (i - 2 < property.nColorNum - property.nWhiteInkNum) { clolorsLabels[i].Text = property.Get_ColorIndex(i - 2); } else { clolorsLabels[i].Text = string.Empty; pumtTimeoutButtons[i].Visible = purgeButtons[i].Visible = tempTextBoxs[i].Visible = pumpButtons[i].Visible = clolorsLabels[i].Visible = mainButtons[i].Visible = reservoirsButtons[i].Visible = false; } } #endif } }
public void OnPrinterPropertyChanged(SPrinterProperty property) { _property = property; for (int i = 0; i < this.reservoirsButtons.Count; i++) { #if false if (i < 2) { if (property.nWhiteInkNum > 0 && i < property.nWhiteInkNum) { reservoirsButtons[i].Text = string.Format("{0}({1})", property.Get_ColorIndex(i + property.nColorNum - property.nWhiteInkNum), i + 1); } else { reservoirsButtons[i].Visible = false; } } else { if (i - 2 < property.nColorNum - property.nWhiteInkNum) { reservoirsButtons[i].Text = string.Format("{0}({1})", property.Get_ColorIndex(i - 2), i + 1); } else { reservoirsButtons[i].Visible = false; } } #endif if (i < property.nColorNum) { reservoirsButtons[i].Text = string.Format("{0}({1})", property.Get_ColorIndex(i), i + 1); reservoirsButtons[i].Visible = true; } else { reservoirsButtons[i].Visible = false; } } }
public void OnPrinterPropertyChanged(SPrinterProperty property) { _property = property; int whiteNum = (_property.nWhiteInkNum & 0x0F); int varnishNum = (_property.nWhiteInkNum >> 4); int len = this.reservoirsButtons.Count; if (whiteNum + varnishNum > 0) { int wIndex = 0; int cIndex = 0; for (int i = 0; i < this.reservoirsButtons.Count; i++) { ColorEnum color = property.Get_ColorEnum(i); bool isWorV = color == ColorEnum.White || color == ColorEnum.Vanish; if (isWorV) { if (wIndex <= whiteNum + varnishNum) { reservoirsButtons[len - whiteNum - varnishNum + wIndex].Text = string.Format("{0}({1})", property.Get_ColorIndex(i), i + 1); } else { reservoirsButtons[len - whiteNum - varnishNum + wIndex].Text = ""; } wIndex++; } else { if (i < property.nColorNum) { reservoirsButtons[cIndex].Text = string.Format("{0}({1})", property.Get_ColorIndex(i), i + 1); } else { reservoirsButtons[cIndex].Text = ""; } cIndex++; } } for (int i = 0; i < this.reservoirsButtons.Count; i++) { reservoirsButtons[i].Visible = !string.IsNullOrEmpty(reservoirsButtons[i].Text.Trim()); } } else { for (int i = 0; i < this.reservoirsButtons.Count; i++) { if (i < property.nColorNum) { reservoirsButtons[i].Text = string.Format("{0}({1})", property.Get_ColorIndex(i), i + 1); reservoirsButtons[i].Visible = true; } else { reservoirsButtons[i].Visible = false; } } } panelPressureW.Visible = whiteNum + varnishNum > 0; }