Prev | Current Page 79 | Next

Guy Fouch?©, Trey Nash

"Accelerated VB 2008"

Access to a public member is not restricted at all.
Protected Member is visible only to the defining class and any class that derives
from the defining class.
Friend Member is visible anywhere inside the containing assembly. This
includes the defining class and any scope within the assembly that is
outside the defining class.
Protected Friend Member is visible within the defining class and anywhere else inside the
assembly. This modifier combines Protected and Friend using a Boolean
OR operation. The member is also visible to any class that derives from the
defining class, whether it??™s in the same assembly or not.
Private Member is visible only within the defining class, with no exceptions.
This is the strictest form of access.
Properties can have mixed access modifiers. A Property getter can be Public, while a
Property setter can be declared as a Friend. This allows every consumer read access, but only
the containing assembly can update the field. In the following example, notice the Friend
modifier on the setter:
Public Property CustomerID() As Integer
Get
Return mCustomerID
End Get
Friend Set(ByVal value As Integer)
mCustomerID = value
End Set
End Property
Class members can use all five variants of the access modifiers.


Pages:
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
reklama pozycjonowanie szkolenia bhp warszawa katalog stron pozycjonowanie