/// <summary> /// Registers the <see cref="ConnectedCallback"/>. /// </summary> public AbstractCommunication(uint screenWidth, StatusChangedDelegate ConnectedCallback = null) { this.screenWidth = screenWidth; if (ConnectedCallback != null) { this.ConnectedCallback += ConnectedCallback; } }
protected void OnStatusChanged() { if (this.StatusChanged != null) { StatusChangedDelegate del = new StatusChangedDelegate(StatusChanged); this.Invoke(del, new object[] { this, new StatusChangedEventArgs(status) }); } // StatusChanged(new StatusChangedEventArgs(status)); //Application.DoEvents(); }
public ArduinoCommunication(SerialPort arduinoSerial, uint screenWidth, StatusChangedDelegate ConnectedCallback = null) : base(screenWidth, ConnectedCallback) { this.arduinoSerial = arduinoSerial; try { Connect(); } catch (IOException) { // do nothing } catch (UnauthorizedAccessException) { // do nothing } }
protected void OnStatusChanged() { if (this.StatusChanged != null) { StatusChangedDelegate del = new StatusChangedDelegate(StatusChanged); this.Invoke(del, new object[] {this, new StatusChangedEventArgs(status) }); } // StatusChanged(new StatusChangedEventArgs(status)); //Application.DoEvents(); }