Click here to Skip to main content
15,886,110 members
Home / Discussions / C#
   

C#

 
GeneralRe: C++ #Define equivalent in C# Pin
Ista14-Aug-03 4:12
Ista14-Aug-03 4:12 
GeneralWorking with Multiple Winforms ComboBox Drop Down Lists C# Pin
mamaflynny13-Aug-03 17:23
mamaflynny13-Aug-03 17:23 
GeneralRe: Working with Multiple Winforms ComboBox Drop Down Lists C# Pin
Ista14-Aug-03 6:49
Ista14-Aug-03 6:49 
Questiona better way? Pin
Member 50926213-Aug-03 17:07
Member 50926213-Aug-03 17:07 
AnswerRe: a better way? Pin
Burt Harris16-Aug-03 17:15
Burt Harris16-Aug-03 17:15 
GeneralRe: a better way? Pin
Member 50926216-Aug-03 22:59
Member 50926216-Aug-03 22:59 
GeneralRe: a better way? Pin
Burt Harris31-Aug-03 11:02
Burt Harris31-Aug-03 11:02 
GeneralCoding Styles for Properties Pin
Alvaro Mendez13-Aug-03 16:08
Alvaro Mendez13-Aug-03 16:08 
I've been looking at a lot of C# code lately and have noticed that many people write property getters and setters inline, like this:

String Name
{
  get { return m_name; }
  set { m_name = value; }
}

I've always like to put curly braces on lines by themselves, but I find this style appealing. The problem is when a getter or setter is more than one line long. Then I end up with something like this:

String Name
{
  get { return m_name; }
  set 
  { 
    if (m_name == value)
      return;
 
    m_name = value;
    UpdateSomething();
  }    
}

So the get is inline but the set is not. I'm not too thrilled about this inconsistency and would like some opinions on the matter.

How do you do it?

Thanks,
Alvaro


If you want to get to the top, prepare to kiss a lot of bottom. -- despair.com
GeneralRe: Coding Styles for Properties Pin
Nick Seng13-Aug-03 16:40
Nick Seng13-Aug-03 16:40 
GeneralRe: Coding Styles for Properties Pin
James T. Johnson13-Aug-03 17:30
James T. Johnson13-Aug-03 17:30 
GeneralRe: Coding Styles for Properties Pin
Arjan Einbu13-Aug-03 21:48
Arjan Einbu13-Aug-03 21:48 
GeneralRe: Coding Styles for Properties Pin
Frank Olorin Rizzi14-Aug-03 6:23
Frank Olorin Rizzi14-Aug-03 6:23 
GeneralRe: Coding Styles for Properties Pin
leppie14-Aug-03 7:07
leppie14-Aug-03 7:07 
GeneralRe: Coding Styles for Properties Pin
James T. Johnson14-Aug-03 7:16
James T. Johnson14-Aug-03 7:16 
GeneralRe: Coding Styles for Properties Pin
Frank Olorin Rizzi14-Aug-03 7:24
Frank Olorin Rizzi14-Aug-03 7:24 
GeneralRe: Coding Styles for Properties Pin
Arjan Einbu13-Aug-03 21:42
Arjan Einbu13-Aug-03 21:42 
GeneralRe: Coding Styles for Properties Pin
Olga.14-Aug-03 1:37
sussOlga.14-Aug-03 1:37 
GeneralRe: Coding Styles for Properties Pin
Frank Olorin Rizzi14-Aug-03 6:21
Frank Olorin Rizzi14-Aug-03 6:21 
GeneralRe: Coding Styles for Properties Pin
Bo Hunter14-Aug-03 9:34
Bo Hunter14-Aug-03 9:34 
GeneralRe: Coding Styles for Properties Pin
A.Wegierski15-Aug-03 20:11
A.Wegierski15-Aug-03 20:11 
GeneralEvents Pin
deanoA13-Aug-03 15:50
deanoA13-Aug-03 15:50 
GeneralRe: Events Pin
J. Dunlap13-Aug-03 16:03
J. Dunlap13-Aug-03 16:03 
GeneralRe: Events Pin
Meysam Mahfouzi13-Aug-03 17:58
Meysam Mahfouzi13-Aug-03 17:58 
GeneralRe: Events Pin
Ista14-Aug-03 4:10
Ista14-Aug-03 4:10 
GeneralDatabase, ODP.NET, ADODC Pin
CyberKewl13-Aug-03 14:28
CyberKewl13-Aug-03 14:28 

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.