void onActivePrinterChanged(object sender, EventArgs e) { connectPrinterButton.Enabled = true; if (functionToCallOnSelect != null) { functionToCallOnSelect(); functionToCallOnSelect = null; } }
void OpenConnectionWindow(ConnectOnSelectFunction functionToCallOnSelect = null) { if (this.connectionWindowIsOpen == false) { connectionWindow = new ConnectionWindow(); this.connectionWindowIsOpen = true; this.functionToCallOnSelect = functionToCallOnSelect; connectionWindow.Closed += new EventHandler(ConnectionWindow_Closed); } else { if (connectionWindow != null) { connectionWindow.BringToFront(); } } }
void OpenConnectionWindow(ConnectOnSelectFunction functionToCallOnSelect = null) { if (this.connectionWindowIsOpen == false) { connectionWindow = new ConnectionWindow(); this.connectionWindowIsOpen = true; //This function gets called on printer selection (see onActivePrinterChanged) this.functionToCallOnSelect = functionToCallOnSelect; connectionWindow.Closed += new EventHandler(ConnectionWindow_Closed); } else { if (connectionWindow != null) { connectionWindow.BringToFront(); } } }