Click here to Skip to main content
15,915,328 members
Home / Discussions / C#
   

C#

 
QuestionUser Level restriction------- which method is best xml or dll ?? Pin
King Julien4-May-09 20:50
King Julien4-May-09 20:50 
AnswerRe: User Level restriction------- which method is best xml or dll ?? Pin
Christian Graus4-May-09 21:16
protectorChristian Graus4-May-09 21:16 
GeneralRe: User Level restriction------- which method is best xml or dll ?? Pin
King Julien4-May-09 21:21
King Julien4-May-09 21:21 
GeneralRe: User Level restriction------- which method is best xml or dll ?? Pin
SeMartens4-May-09 21:30
SeMartens4-May-09 21:30 
GeneralRe: User Level restriction------- which method is best xml or dll ?? Pin
King Julien4-May-09 21:40
King Julien4-May-09 21:40 
Questionget set property Pin
lakhwinder.ghuman4-May-09 20:49
lakhwinder.ghuman4-May-09 20:49 
AnswerRe: get set property Pin
King Julien4-May-09 21:01
King Julien4-May-09 21:01 
GeneralRe: get set property Pin
OriginalGriff4-May-09 21:59
mveOriginalGriff4-May-09 21:59 
To add to this most excellent reply, they also aid with encapsulation. Because you expose a method rather than a field with get, set, the implementing class can replace the internal implementation of the property without affecting the outside world. If your class keeps a hard count of elements in a tree (say) and exposes that via "public int count" then it must retain that count for all time. If it is exposed via
public int Count
   {
   get { return count; }
   set {count = value; }
   }

then it is at liberty to dispose of the "count" field and replace it with a new implementation at will. This will not affect classes relying on the "Count".

Further, it allow you to error check the assignments:
public int Count
   {
   get { return count; }
   set 
      {
      if ((value < 100) && (count >= 0))
         {
         count = value;
         }
      else
         {
         throw new Exception(string.Format("Value out of range: {0}", value));
         }
      }
   }


But I agree - read a book, because if you don't know this stuff, there are a lot of other complexities you need to be aware of before you go much further!
Good luck.

No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

AnswerRe: get set property Pin
Member 44703545-May-09 0:00
Member 44703545-May-09 0:00 
QuestionHow to read CSV file Pin
kaushik_dass4-May-09 20:38
kaushik_dass4-May-09 20:38 
AnswerRe: How to read CSV file Pin
King Julien4-May-09 21:09
King Julien4-May-09 21:09 
GeneralRe: How to read CSV file Pin
kaushik_dass4-May-09 21:15
kaushik_dass4-May-09 21:15 
GeneralRe: How to read CSV file Pin
Dave Kreskowiak5-May-09 4:31
mveDave Kreskowiak5-May-09 4:31 
AnswerRe: How to read CSV file [modified] Pin
Jack Li4-May-09 21:46
Jack Li4-May-09 21:46 
QuestionConfirm message on successful validation Pin
Ramkithepower4-May-09 20:27
Ramkithepower4-May-09 20:27 
AnswerRe: Confirm message on successful validation Pin
Christian Graus4-May-09 20:35
protectorChristian Graus4-May-09 20:35 
AnswerRe: Confirm message on successful validation [modified] Pin
mohmeh834-May-09 20:42
mohmeh834-May-09 20:42 
GeneralRe: Confirm message on successful validation Pin
Ramkithepower4-May-09 20:50
Ramkithepower4-May-09 20:50 
GeneralRe: Confirm message on successful validation [modified] Pin
mohmeh834-May-09 21:16
mohmeh834-May-09 21:16 
AnswerRe: Confirm message on successful validation Pin
Jack Li4-May-09 21:50
Jack Li4-May-09 21:50 
QuestionTyped DataSets Pin
Illegal Operation4-May-09 19:16
Illegal Operation4-May-09 19:16 
AnswerRe: Typed DataSets Pin
N a v a n e e t h4-May-09 19:36
N a v a n e e t h4-May-09 19:36 
AnswerRe: Typed DataSets Pin
saanj4-May-09 20:10
saanj4-May-09 20:10 
QuestionHow can I know raw header information through BHO? Pin
svt gdwl4-May-09 18:39
svt gdwl4-May-09 18:39 
Questiondebuggin in windows service Pin
mark_me4-May-09 13:54
mark_me4-May-09 13:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.