[dba-VB] C# Scope

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Sat Nov 5 13:32:13 CDT 2011


No, John, I mean a separate assembly/project with type ClassLibrary. 

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 ?. 20:12
To: Discussion concerning Visual Basic and related programming issues.
Subject: Re: [dba-VB] C# Scope

Thanks Shamil.  When you say "class library" do you mean a container module?

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.
>
>
_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com




More information about the dba-VB mailing list