jwcolby
jwcolby at colbyconsulting.com
Sat Nov 5 12:15:35 CDT 2011
The problem that I have here is that the RunState class can potentially be used by any other class. The point of the RunState class is to encapsulate all of the stuff to define a RunState state machine, and any complex class can have a RunState. In fact some of my classes have several RunState classes. John W. Colby Colby Consulting Reality is what refuses to go away when you do not believe in it On 11/5/2011 12:56 PM, Shamil Salakhetdinov wrote: > John, > > If you put class runState and class myClassParent in one class library and > class myGrandParent in another class library referencing the first one then > the following code would be the scoping solution you're looking for: > > ==== classlib1 ==== > public class runState > { > public ... mStart() {...} > internal ... mStarted() {...} > } > > public class myClassParent > { > runState myRunState > } > > ===== classlib2 === > > public class myGrandParent > { > myClassParent MyClassParent; > } > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ?????? 2011 ?. 19:30 > To: VBA > Subject: [dba-VB] C# Scope > > Suppose I have a set of classes: > > class runState > { > mStart() > { > } > > mStarted() > { > } > } > > class myClassParent > { > runState myRunState; > > } > > class myGrandParent > { > myClassParent MyClassParent; > } > > Is there any way to scope runState.mStarted to be visible to MyClassParent > but not visible to the grandparent while making runState.mStart visible to > MyClassParent and MyClassGrandparent? > > In other words the grandparent should be able to call the parent's > runState.mStart but not be able to call the runState.mStarted. Only the > parent should be able to call runState.MStarted. > >