Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Only can be accessed by member in same library
Message
De
27/01/2002 10:23:11
 
 
À
27/01/2002 04:38:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00611212
Message ID:
00611261
Vues:
15
Oh, I see... If you mean specifying access level not only for sublasses but for classes near-by, you may check the ClassLibrary property in your method - you should make it Public visible in order to allow executing it from code outside the class, but in it you should have some code like this:
LOCAL lcSenderName, lcPreviousStackCmd, loSender, llContinueProceeding

llContinueProceeding = .F.
lcPreviousStackCmd = PROGRAM(PROGRAM(-1)-1)
lcSenderName = SUBSTR(lcPreviousStackCmd, 1, RAT([.],lcPreviousStackCmd)-1)
IF !EMPTY(lcSenderName) AND TYPE(lcSenderName)=[O] Then
	loSender = EVALUATE(lcSenderName)
	IF PEMSTATUS(loSender, 'ClassLibrary', 5) Then
		IF loSender.ClassLibrary == This.ClassLibrary Then
			llContinueProceeding = .T.
		ENDIF
	ENDIF
ENDIF

IF !llContinueProceeding Then
	RETURN .f.	&& or maybe raise an ERROR?
EndIF

*** Your code
Note that in this case this method still can be executed from outside, if the developer subclasses your original class in your library and adds a method that calls the method 'protected' by the code above.

HTH
Zlatin Zlatev,
MCSD (VS6)

Make solutions, not programs!

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform