public virtual void Dispose() { if (IsDisposed) { throw new ObjectDisposedException(GetType().FullName, "This object is already disposed!"); } IsDisposed = true; DisposeCounter.Increment(GetType()); }
public virtual void Dispose() { var type = GetType().GetTypeInfo(); if (type.Namespace.StartsWith("Castle.Proxies")) { type = type.BaseType.GetTypeInfo(); } if (IsDisposed) { throw new ObjectDisposedException(type.FullName, "This object is already disposed!"); } IsDisposed = true; DisposeCounter.Increment(type.AsType()); }