C
cody
The error is probably because proteced members do not make sense in a sealed
class. From a sealed class cannot be inherited from but protected members
can be accessed from the class itself and derived classes.
You should make the method private or public instead.
--
cody
Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
singleton.
same time holding to the singleton design pattern.
class. From a sealed class cannot be inherited from but protected members
can be accessed from the class itself and derived classes.
You should make the method private or public instead.
--
cody
Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
object will be used I decided the best bet would be to make the object aDan said:All,
I am developing an Object that wraps an old C library. Baeed upon how the
singleton.
should implement a dispose method to ensure that those resounrce are freed.Additionally, because the object is working with unmanaged resources it
member declared in sealed classHere is the basic code for the object's constructor and dispose method
public sealed class IAClientImport : IDisposable
{
private static volatile IAClientImport instance;
private static object syncRoot = new Object();
private bool _Disposed = false;
private IAClientImport() {}
public static IAClientImport Instance
{
get
{
if ( instance == null )
{
lock ( syncRoot )
{
if ( instance == null )
instance = new IAClientImport();
}
}
return instance;
}
public void Dispose()
{
Dispose( true );
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if ( !this._Disposed )
{
if ( disposing ) { /*Dispose Managed Resources Here*/ }
//Dispose Managed Reources - The Handle To The IA Client Object
}
this._Disposed = true;
}
~IAClientImport()
{
Dispose(false);
}
}
The problem that I am having is that when I attempt to compile the object I get the following two errors
(1489): 'FNIS.InputAccel.IAClientImport.Dispose(bool)' : new protected
member in a sealed class 'FNIS.InputAccel.IAClientImport'(1489): 'FNIS.InputAccel.IAClientImport.Dispose(bool)' is a new virtual
the unmanaged resources in the object get disposed of properly while at theI am a bit confused as to what I need to change in order to ensure that
same time holding to the singleton design pattern.