Dear Sir,
I'm Trying convert from c# to vb.net but error like this :
Error BC30695 sub 'Dispose' must be declared 'Shadows' because another member with this name is declared 'Shadows'.
public new void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
// Flag: Has Dispose already been called?
bool _disposed = false;
// Protected implementation of Dispose pattern.
protected override void Dispose(bool disposing)
{
if (!this._disposed)
{
if (disposing)
{
// Free any managed objects here.
//
if (this._currentBrush != null)
{
this._currentBrush.Dispose();
}
if (this.CurrentPen != null)
{
this._currentPen.Dispose();
}
if (this._layers != null)
{
this._layers.Dispose();
}
if (this.tools != null)
{
foreach (Tool tool in tools)
{
if (tool != null)
{
tool.Dispose();
}
}
}
if (this.undoManager != null)
{
this.undoManager.Dispose();
}
if (components != null)
{
components.Dispose();
}
// Free any unmanaged objects here.
}
this._disposed = true;
}
base.Dispose(disposing);
}
~DrawArea()
{
this.Dispose(false);
}
Code in vb.net
Public Shadows Sub Dispose() Implements IDisposable.Dispose
Me.Dispose(True)
GC.SuppressFinalize(Me)
End Sub
' Flag: Has Dispose already been called?
Private _disposed As Boolean = False
' Protected implementation of Dispose pattern.
`error below line
Protected Overrides Shadows Sub Dispose(ByVal disposing As Boolean)
If Not Me._disposed Then
If disposing Then
' Free any managed objects here.
'
If Me._currentBrush IsNot Nothing Then
Me._currentBrush.Dispose()
End If
If Me.CurrentPen IsNot Nothing Then
Me._currentPen.Dispose()
End If
If Me._layers IsNot Nothing Then
Me._layers.Dispose()
End If
If Me.tools IsNot Nothing Then
For Each tool As Tool In tools
If tool IsNot Nothing Then
tool.Dispose()
End If
Next tool
End If
If Me.undoManager IsNot Nothing Then
Me.undoManager.Dispose()
End If
If components IsNot Nothing Then
components.Dispose()
End If
' Free any unmanaged objects here.
End If
Me._disposed = True
End If
MyBase.Dispose(disposing)
End Sub
Protected Overrides Sub Finalize()
Me.Dispose(False)
End Sub