Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Restricted access to a class
Message
De
25/05/2012 13:49:00
 
 
À
25/05/2012 13:31:48
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01544358
Message ID:
01544427
Vues:
20
>If you want to hide it completely then you must mark it private. In that case you would have to explicitly expose members to the outside world. ie. you end up with something like this:
Public Class Upload
>	Friend Sub New()
>	End Sub
>	Friend Property SomeProperty() As String
>		Get
>			Return m_SomeProperty
>		End Get
>		Set
>			m_SomeProperty = Value
>		End Set
>	End Property
>	Private m_SomeProperty As String
>
>	Friend Function DoSomething(s As String) As String
>	End Function
>End Class
>
>Public Class PublicClass
>	Private oUpload As New Upload()
>
>	Public Property SomeProperty() As String
>		Get
>			Return oUpload.SomeProperty
>		End Get
>		Set
>			oUpload.SomeProperty = value
>		End Set
>	End Property
>
>	Public Function DoSomething(s As String) As String
>		Return oUpload.DoSomething(s)
>	End Function
>End Class
Ah, the famous Get/Set approach, thanks for the info
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform