/// <summary> /// Disposing pattern. /// </summary> /// <param name="disposing"> /// True if called from <see cref="Dispose"/>, false if called from the finalizer. /// </param> protected virtual void Disposing(bool disposing) { if (!_disposed) { try { Logout(); } catch { // Ignore any errors. We tried. :-) } SessionId = null; try { SoapClient.Close(); } catch { // Ignore any errors. We tried. :-) } _disposed = true; } }
public void Dispose() { Client?.Close(); Client = null; }