Tutorials
Resources
Forum
Reviews
Communities
Interview
Jobs
Projects
Training
Your
Ad
Here
Silverlight Games
|
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Polls
|
Revenue Sharing
|
Lobby
|
Gift Shop
|
Prizes & Awards
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Abhisek Panda
(40)
Alwyn
(34)
soniumesh
(14)
Last 7 Days
Alwyn
(698)
nishithraj
(512)
Gaurav Arora
(494)
more...
Resources
»
Tips
»
General
»
Providing dfifferent accessibility for get/set of properties
Posted Date: 19 Jun 2008
Resource Type:
Tips
Category:
General
Author:
Lekshmi m nair
Member Level:
Silver
Rating:
Points
: 5
To restrict access to either of get or set accessor of a Property, this feature is used. Typically, this involves restricting the accessibility of the set accessor, while keeping the get accessor publicly accessible.
For example:
public string ReadOnly {
get
{
return name;
}
protected set
{ name = value;
}
}
Different access modifiers are generally the cases when one might need to "set" a property inside an assembly and does not want give access outside it. In the above example, the "set" accessor is "protected" meaning only inherited classes can set the property while others can only "get" it.
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
to add tags.
Different access modifiers for get and set of a Property
.
Access Modifiers for Properties
.
Access Modifiers for get and set Properties
.
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
Meaning(Expantion) for VIRUS,COMPUTER
Previous Resource:
Prefer new and delete operators over malloc and free
Return to Discussion Resource Index
Post New Resource
Category:
General
Post resources and
earn money
!
More Resources
Meaning(Expantion) for VIRUS,COMPUTER
Very Important for PC Users
identifying a system table
Coding Standard & Code Review Points [Dot Net]
Advanced find in outlook
Remove Lost Password from outlook
dotNet Slackers
About Us
Contact Us
Privacy Policy
Terms Of Use