J
Jack Addington
I have create a base class for a user control as well as a related base
class for its logic (nonvisual). As part of the non-visual class I have a
variable that references the base user object and a property to set it.
class VisualBase : ...Control { ... }
class LogicBase
{
private VisualBase _vObj;
public VisualBase VObj {get;set;}
}
Now I then went and inherited from both and created much more advanced
objects (VisualChild and LogicChild). I need a reference to the VisualChild
in the LogicChild but I wasn't sure the best way to code it. Do I just
rename the original or should I just change the property type. The question
then is in the other methods of the base/child logic class should I be using
the private _vObj or the public VObj property?
Should it be:
class LogicChild : LogicBase
{
public VisualChild VObj
{ get { return (VisualChild) _vObj;}
{ set { _vObj = (VisualBase)Value;}
}
or do I just add a new private variable of type VisualChild?
I've tried a few things and the compiler seems to let me get away with it so
I would appreciate any help.
thanks kindly,
jack
class for its logic (nonvisual). As part of the non-visual class I have a
variable that references the base user object and a property to set it.
class VisualBase : ...Control { ... }
class LogicBase
{
private VisualBase _vObj;
public VisualBase VObj {get;set;}
}
Now I then went and inherited from both and created much more advanced
objects (VisualChild and LogicChild). I need a reference to the VisualChild
in the LogicChild but I wasn't sure the best way to code it. Do I just
rename the original or should I just change the property type. The question
then is in the other methods of the base/child logic class should I be using
the private _vObj or the public VObj property?
Should it be:
class LogicChild : LogicBase
{
public VisualChild VObj
{ get { return (VisualChild) _vObj;}
{ set { _vObj = (VisualBase)Value;}
}
or do I just add a new private variable of type VisualChild?
I've tried a few things and the compiler seems to let me get away with it so
I would appreciate any help.
thanks kindly,
jack