private void OnCustomButtonClicked(object sender, csEventArgs e) { if (CustomButtonClicked != null) { CustomButtonClicked(sender, e); } }
public void SetPrinterStatusChanged(JetStatusEnum status) { PrinterOperate po = PrinterOperate.UpdateByPrinterStatus(status); if (bSelfRaised && status == JetStatusEnum.Measuring) { bMeasuring = true; bSelfRaised = false; } if (bMeasuring && status == JetStatusEnum.Ready && !bAutoMeasure //不是自动测高,或者自动测高已经更新了结果 ) { bSelfRaised = bMeasuring = false; if (IsMeasureBeforePrint) { string m1 = ResString.GetEnumDisplayName(typeof(Confirm), Confirm.PrintNow); DialogResult result = MessageBox.Show(m1, ResString.GetProductName(), MessageBoxButtons.YesNo, MessageBoxIcon.Question); csEventArgs eventArgs = new csEventArgs() { Case = _case, Dr = DialogResult.Cancel }; if (result == DialogResult.Yes) { eventArgs.Dr = DialogResult.OK; } //CoreInterface.SendJetCommand((int)JetCmdEnum.BackToHomePoint, (int)AxisDir.X); OnCustomButtonClicked(null, eventArgs); } else { string m1 = ResString.GetEnumDisplayName(typeof(Confirm), Confirm.GoHome); DialogResult result = MessageBox.Show(m1, ResString.GetProductName(), MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result != DialogResult.No) { CoreInterface.SendJetCommand((int)JetCmdEnum.BackToHomePoint, (int)AxisDir.X); } } } this.buttonCancel.Enabled = po.CanMoveStop; this.m_ButtonManualMove.Enabled = this.m_ButtonMeasureThick.Enabled = this.m_ButtonMeasureThick2.Enabled = po.CanMoveUp && po.CanMoveDown; }