private void Dispose(bool disposing) { foreach (int pin in _openPins) { _driver.ClosePin(pin); } _openPins.Clear(); _driver.Dispose(); }
/// <summary> /// Disposes this instance and closes all open pins associated with this controller. /// </summary> /// <param name="disposing">True to dispose all instances, false to dispose only unmanaged resources</param> protected virtual void Dispose(bool disposing) { foreach (int pin in _openPins) { // The list contains the pin in the current NumberingScheme ClosePinCore(pin); } _openPins.Clear(); _driver?.Dispose(); _driver = null !; }