|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Property: ReadOnly on public scope while Read-Write on friend or private scopeHi,
Below is my scenario... I want to restrict my clients to access one of my class property in ReadOnly mode. At the same time as an author of the component i would like to have read-write access on it. I tried to write 'Public ReadOnly' and 'Private WriteOnly', but didn't work. Is there a way other than doing (i) direct variable access or (ii) through another property/method with a different name? Thanks, Saran. Saran wrote:
> Hi, VB 2002/3: No> > Below is my scenario... > > I want to restrict my clients to access one of my class property > in ReadOnly mode. At the same time as an author of the component i > would like to have read-write access on it. > > I tried to write 'Public ReadOnly' and 'Private WriteOnly', but > didn't work. > > Is there a way other than doing (i) direct variable access or (ii) > through another property/method with a different name? VB 2005: Yes: Public Property Foo() As String Get End Get Private Set(ByVal value As String) End Set End Property Clients will not be able to Set the property. -- Larry Lard larryl***@googlemail.com The address is real, but unread - please reply to the group For VB and C# questions - tell us which version
Default date
Combining datatables HELP! Why is SqlException being caught in this code if it can't connect to SQL Server? Public Shared Property Barcode scanning Display Unicode characters on Winforms concurrency question Refreshing datagridview after a rowtemplate height change ADO.NET in VB6 String comparison algorithms |
|||||||||||||||||||||||