Visual Basic (Declaration) | |
---|---|
Public Overloads Sub Dispose() |
C# | |
---|---|
public void Dispose() |
Library/Library.Test/TestDisposable.cs
C# | Copy Code |
---|---|
MyDisposable o = new MyDisposable(); using (o) { Assert.AreEqual(0, o._disposedCount); o.Dispose(); Assert.AreEqual(1, o._disposedCount); o.Dispose(); Assert.AreEqual(1, o._disposedCount); } Assert.AreEqual(1, o._disposedCount); |
VB.NET | Copy Code |
---|---|
Dim o As New MyDisposable() Using o Assert.AreEqual(0, o._disposedCount) o.Dispose() Assert.AreEqual(1, o._disposedCount) o.Dispose() Assert.AreEqual(1, o._disposedCount) End Using Assert.AreEqual(1, o._disposedCount) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
Disposable ClassDisposable Members
Overload List
Source Code
Library/Bases/Disposable.csUsed By
BackgroundWriter.Close()FragmentedFile.Dispose()