S
sean.j.gage
I was trying to abstract some properties and methods for a group of
remoting objects, but it seems that during testing I am finding that
the remoting objects are generating null reference exceptions when I
try to access these properties and methods. Below is a sample of what
I was attempting to do.
public class ParentManager : MarshalObjByRef
{
private string enabled;
protected string Enabled
{
get { return this.enabled; }
set { this.enabled = value; }
}
protected void Initialize(string value)
{
this.enabled = value;
}
}
public class SubManager : ParentManager
{
public SubManager()
{
this.Initialize("TRUE");
}
public void Test()
{
if(this.enabled.Equals("TRUE"))
{
Console.WriteLine("SubManager is enabled.");
}
}
}
When I call test I get a Null reference exception because the
initialize function has not be executed.
Cheers!
remoting objects, but it seems that during testing I am finding that
the remoting objects are generating null reference exceptions when I
try to access these properties and methods. Below is a sample of what
I was attempting to do.
public class ParentManager : MarshalObjByRef
{
private string enabled;
protected string Enabled
{
get { return this.enabled; }
set { this.enabled = value; }
}
protected void Initialize(string value)
{
this.enabled = value;
}
}
public class SubManager : ParentManager
{
public SubManager()
{
this.Initialize("TRUE");
}
public void Test()
{
if(this.enabled.Equals("TRUE"))
{
Console.WriteLine("SubManager is enabled.");
}
}
}
When I call test I get a Null reference exception because the
initialize function has not be executed.
Cheers!