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

C#

 
GeneralRe: Using C# like remote desktop? Pin
InvalidTypecast25-Sep-07 8:49
InvalidTypecast25-Sep-07 8:49 
QuestionC# relating to SET and GET Pin
Daniel Hood24-Sep-07 9:25
Daniel Hood24-Sep-07 9:25 
AnswerRe: C# relating to SET and GET Pin
pmarfleet24-Sep-07 9:36
pmarfleet24-Sep-07 9:36 
GeneralRe: C# relating to SET and GET Pin
Colin Angus Mackay24-Sep-07 10:40
Colin Angus Mackay24-Sep-07 10:40 
GeneralRe: C# relating to SET and GET Pin
Daniel Hood24-Sep-07 10:48
Daniel Hood24-Sep-07 10:48 
AnswerRe: C# relating to SET and GET Pin
Pete O'Hanlon24-Sep-07 9:36
mvePete O'Hanlon24-Sep-07 9:36 
GeneralRe: C# relating to SET and GET Pin
Daniel Hood24-Sep-07 10:46
Daniel Hood24-Sep-07 10:46 
GeneralRe: C# relating to SET and GET Pin
Pete O'Hanlon24-Sep-07 22:16
mvePete O'Hanlon24-Sep-07 22:16 
You have - although it offers more. Suppose that you want to change the length that is allowed - instead of having to search through every piece of code that calls this and change the length there, you can do it in one place here. Also, you can create a simple "dirty" check by doing:
public class MyClass
{
  private string _myString = string.Empty;
  private int _myInt = 0;
  private bool _isDirty = false;

  public string MyString
  {
    get { return _myString ; } 
    set
    {
      if (_myString != value)
      {
        _myString = value;
        _isDirty = true;
      }
    }
  }

  public int MyInt
  {
    get { return _myInt; } 
    set
    {
      if (_myInt != value)
      {
        _myInt = value;
        _isDirty = true;
      }
    }
  }

  public bool IsDirty
  {
    get { return _isDirty; }
  }

  public void Save()
  {
    // Save the record to the database....
    // then reset the "dirty" flag.
    _isDirty = false;
  }
}
This is only one example of the type of thing that you can do with properties.

Deja View - the feeling that you've seen this post before.

QuestionMS Application Block : SQLHelper [modified] Pin
ss.mmm24-Sep-07 9:08
ss.mmm24-Sep-07 9:08 
AnswerRe: MS Application Block : SQLHelper Pin
pmarfleet24-Sep-07 9:22
pmarfleet24-Sep-07 9:22 
QuestionSecuring PDF Files Pin
adnanrafiq24-Sep-07 9:04
adnanrafiq24-Sep-07 9:04 
QuestionCode for Traveling Salesman Problems Pin
laremtj24-Sep-07 8:58
laremtj24-Sep-07 8:58 
AnswerRe: Code for Traveling Salesman Problems Pin
Pete O'Hanlon24-Sep-07 9:06
mvePete O'Hanlon24-Sep-07 9:06 
GeneralRe: Code for Traveling Salesman Problems Pin
Paul Conrad24-Sep-07 13:26
professionalPaul Conrad24-Sep-07 13:26 
AnswerRe: Code for Traveling Salesman Problems Pin
Scott Dorman24-Sep-07 9:11
professionalScott Dorman24-Sep-07 9:11 
AnswerRe: Code for Traveling Salesman Problems Pin
Dan Neely24-Sep-07 9:48
Dan Neely24-Sep-07 9:48 
GeneralRe: Code for Traveling Salesman Problems Pin
Scott Dorman24-Sep-07 9:59
professionalScott Dorman24-Sep-07 9:59 
GeneralRe: Code for Traveling Salesman Problems Pin
Pete O'Hanlon24-Sep-07 10:01
mvePete O'Hanlon24-Sep-07 10:01 
AnswerRe: Code for Traveling Salesman Problems Pin
Paul Conrad24-Sep-07 13:26
professionalPaul Conrad24-Sep-07 13:26 
QuestionMapping CSV files Pin
jebin k24-Sep-07 7:14
jebin k24-Sep-07 7:14 
AnswerRe: Mapping CSV files Pin
martin_hughes24-Sep-07 9:35
martin_hughes24-Sep-07 9:35 
QuestionHow to make windows application like master page? Pin
Shahriat Hossain24-Sep-07 7:06
Shahriat Hossain24-Sep-07 7:06 
AnswerRe: How to make windows application like master page? Pin
Not Active24-Sep-07 7:39
mentorNot Active24-Sep-07 7:39 
AnswerRe: How to make windows application like master page? Pin
Matthew Cuba24-Sep-07 7:42
Matthew Cuba24-Sep-07 7:42 
AnswerRe: How to make windows application like master page? Pin
Pete O'Hanlon24-Sep-07 8:50
mvePete O'Hanlon24-Sep-07 8:50 

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.