在没有Dispose函数的情况下实现IDisposable的类?

时间:2016-09-07 09:42:29

标签: c# idisposable websocket-sharp

我刚刚通过nuget进入WebSocketSharp 它的课程WebSocket实施IDisposable,但似乎没有Dispose方法。
怎么可能?我想如果你实现了一个接口,你还必须实现它的所有属性/方法。

Screenshot

1 个答案:

答案 0 :(得分:4)

source的GitHub上:

#region Explicit Interface Implementations

/// <summary>
/// Closes the WebSocket connection, and releases all associated resources.
/// </summary>
/// <remarks>
/// This method closes the connection with <see cref="CloseStatusCode.Away"/>.
/// </remarks>
void IDisposable.Dispose ()
{
  close (new CloseEventArgs (CloseStatusCode.Away), true, true, false);
}

#endregion
相关问题