/// <summary> /// Implements the Dispose pattern /// </summary> /// <param name="disposing">Whether this object is being disposed via a call to Dispose /// or garbage collected.</param> protected virtual void Dispose(bool disposing) { if (!isDisposed) { if (disposing && client != null && shouldDispose) { client.Dispose(); client = null; } isDisposed = true; } }