public void ButtonCallback(ButtonWidget button) { if (m_bUpdating || button.ID > 10000) { return; } PrinterObject selectedPrinter = m_oSpoolerConnection.SelectedPrinter; if (selectedPrinter == null) { return; } if (button.ID == 10000) { AccessoriesProfile.NozzleProfile nozzleConstants = selectedPrinter.MyPrinterProfile.AccessoriesConstants.NozzleConstants; CustomNozzleSizeDialog.Show(Host, m_oMessagebox, new EventHandler <CustomNozzleSizeDialog.CustomNozzleSizeResult>(OnCustomNozzleSizeDialogClosed), nozzleConstants.iMinimumNozzleSizeMicrons, nozzleConstants.iMaximumNozzleSizeMicrons, selectedPrinter); } else { SelectAppropriateButton(button.ID); SetNozzleSize(selectedPrinter, button.ID); } }
public static void Show(GUIHost guiHost, PopupMessageBox messagebox, EventHandler <CustomNozzleSizeDialog.CustomNozzleSizeResult> OnDialogClose, int iMinNozzleSize, int iMaxNozzleSize, PrinterObject printer) { var nozzleSizeDialog = new CustomNozzleSizeDialog(guiHost, messagebox, OnDialogClose, iMinNozzleSize, iMaxNozzleSize, printer); guiHost.GlobalChildDialog += nozzleSizeDialog; }