Imports System.Diagnostics.CodeAnalysis
Imports System.IO

Namespace Microsoft.Usage

    Public Class Rule2220
        Inherits Rule2220Base
        ' このメソッドは CA2220 に違反しています。
        <SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")> _
        <SuppressMessage("Microsoft.Performance", "CA1821:RemoveEmptyFinalizers")> _
        Protected Overrides Sub Finalize()
        End Sub
    End Class

    Public Class Rule2220Base
        Implements IDisposable

        Private stream As MemoryStream = New MemoryStream()

        Private disposedValue As Boolean



        Protected Overrides Sub Finalize()
            Dispose(False)
        End Sub

        Protected Overridable Sub Dispose(ByVal disposing As Boolean)
            If Not Me.disposedValue Then
                If disposing Then
                End If
                Me.stream.Dispose()
            End If
            Me.disposedValue = True
        End Sub

        Public Sub Dispose() Implements IDisposable.Dispose
            Dispose(True)
            GC.SuppressFinalize(Me)
        End Sub

    End Class

End Namespace
