[dba-VB] C# Scope

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Sat Nov 5 11:56:58 CDT 2011


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.


-- 
John W. Colby
Colby Consulting

Reality is what refuses to go away
when you do not believe in it
_______________________________________________
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