Click here to Skip to main content
15,888,351 members
Home / Discussions / C#
   

C#

 
AnswerRe: USB port Pin
OriginalGriff15-Sep-15 21:39
mveOriginalGriff15-Sep-15 21:39 
GeneralRe: USB port Pin
Member 1198669116-Sep-15 15:54
Member 1198669116-Sep-15 15:54 
AnswerRe: USB port Pin
Eddy Vluggen17-Sep-15 22:54
professionalEddy Vluggen17-Sep-15 22:54 
QuestionDynamicly created ErrorProvider and garbage collection Pin
TMattC14-Sep-15 20:37
TMattC14-Sep-15 20:37 
AnswerRe: Dynamicly created ErrorProvider and garbage collection Pin
Eddy Vluggen14-Sep-15 23:36
professionalEddy Vluggen14-Sep-15 23:36 
QuestionRe-Get and Set Property Pin
Member 1116162514-Sep-15 20:02
Member 1116162514-Sep-15 20:02 
AnswerRe: Get and Set Property Pin
Peter Leow14-Sep-15 20:27
professionalPeter Leow14-Sep-15 20:27 
AnswerRe: Get and Set Property Pin
OriginalGriff14-Sep-15 21:40
mveOriginalGriff14-Sep-15 21:40 
Property get lets you retrieve the value of the property by calling a method to evaluate the property's current value, with syntactic sugar to make it look like a variable.
Property set does the same thing, but it allows you to set the value.
For example, your class may store the user information as "first name" and "second name" internally, and provide a Property FullName:
C#
private string firstName = "";
private string lastName = "";
public string FullName 
   {
   get { return string.Format("{0} {1}", firstName, lastName); }
   set
      {
      string[] parts = value.Split(' ');
      if (parts.Length != 2) throw new ArgumentException("Full name requires a first and last name: " + value);
      firstName = parts[0];
      lastName = parts[1];
      }
   }
To provide a getter only is easy - there are two ways:
C#
public string MyProperty { get { return "Hello"; }}

Requires no setter.
Or you could have a private setter:
C#
private string _MyProperty = "Hello";
public string MyProperty
   {
   get { return _MyProperty; }
   private set { _MyProperty = value; }
   }
This allows your class to set the value, but the outside world can only see the getter.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

AnswerRe: Get and Set Property Pin
V.14-Sep-15 21:52
professionalV.14-Sep-15 21:52 
AnswerRe: Get and Set Property Pin
BillWoodruff15-Sep-15 0:42
professionalBillWoodruff15-Sep-15 0:42 
Questionhow to compare two data tables having same column and contain some values according to column name using stored procedure in sql dbx? Pin
Member 1198440814-Sep-15 19:06
Member 1198440814-Sep-15 19:06 
GeneralRe: how to compare two data tables having same column and contain some values according to column name using stored procedure in sql dbx? Pin
Richard MacCutchan14-Sep-15 21:33
mveRichard MacCutchan14-Sep-15 21:33 
AnswerRe: how to compare two data tables having same column and contain some values according to column name using stored procedure in sql dbx? Pin
Mycroft Holmes14-Sep-15 21:37
professionalMycroft Holmes14-Sep-15 21:37 
AnswerRe: how to compare two data tables having same column and contain some values according to column name using stored procedure in sql dbx? Pin
ngoj17-Sep-15 3:13
ngoj17-Sep-15 3:13 
Questionseprating axis swept; Pin
Isawyouoo14-Sep-15 12:58
Isawyouoo14-Sep-15 12:58 
QuestionRe: seprating axis swept; Pin
Matt T Heffron14-Sep-15 13:17
professionalMatt T Heffron14-Sep-15 13:17 
AnswerRe: seprating axis swept; Pin
Isawyouoo14-Sep-15 13:57
Isawyouoo14-Sep-15 13:57 
QuestionUrgently need C# code for pushing files from one server to another server Pin
Naga Nanda Kishore14-Sep-15 6:59
Naga Nanda Kishore14-Sep-15 6:59 
AnswerRe: Urgently need C# code for pushing files from one server to another server Pin
Eddy Vluggen14-Sep-15 7:29
professionalEddy Vluggen14-Sep-15 7:29 
AnswerRe: Urgently need C# code for pushing files from one server to another server Pin
OriginalGriff14-Sep-15 8:09
mveOriginalGriff14-Sep-15 8:09 
AnswerRe: Urgently need C# code for pushing files from one server to another server Pin
Gerry Schmitz14-Sep-15 9:26
mveGerry Schmitz14-Sep-15 9:26 
JokeRe: Urgently need C# code for pushing files from one server to another server Pin
Eddy Vluggen14-Sep-15 9:38
professionalEddy Vluggen14-Sep-15 9:38 
GeneralRe: Urgently need C# code for pushing files from one server to another server Pin
Gerry Schmitz14-Sep-15 9:54
mveGerry Schmitz14-Sep-15 9:54 
GeneralRe: Urgently need C# code for pushing files from one server to another server Pin
Eddy Vluggen14-Sep-15 10:05
professionalEddy Vluggen14-Sep-15 10:05 
GeneralRe: Urgently need C# code for pushing files from one server to another server Pin
Gerry Schmitz14-Sep-15 10:29
mveGerry Schmitz14-Sep-15 10:29 

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.