Access Control for Properties

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. I am currently trying to implement access control on a property (i.e.
public get, protected set). However, I get a compiler error if I use the
public or protected keywords on get or set. I also get an error if I redefine
the property with the other accessor using a different access level. Does
anyone have any ideas?
Reuben.
 
PS. I think this can be done in C# 2.0, but unfortunatly I have to use .NET
Framework 1.0.
 
You can not set different visibility levels for the get and set accessors in
VS.NET 2002/2003, the visibility is set in the property declaration only
once. I think that you can in VS 2005

--
Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
Back
Top