Click here to Skip to main content
15,906,106 members
Home / Discussions / C#
   

C#

 
AnswerRe: A good looking TreeView Pin
Anurag Gandhi2-Feb-10 19:23
professionalAnurag Gandhi2-Feb-10 19:23 
JokeRe: A good looking TreeView Pin
Ravi Bhavnani3-Feb-10 2:06
professionalRavi Bhavnani3-Feb-10 2:06 
QuestionDecryption algorithm Pin
3bood.ghzawi2-Feb-10 9:34
3bood.ghzawi2-Feb-10 9:34 
AnswerMessage Closed Pin
2-Feb-10 9:56
stancrm2-Feb-10 9:56 
GeneralRe: Decryption algorithm Pin
3bood.ghzawi2-Feb-10 11:42
3bood.ghzawi2-Feb-10 11:42 
GeneralRe: Decryption algorithm Pin
Mycroft Holmes2-Feb-10 11:57
professionalMycroft Holmes2-Feb-10 11:57 
GeneralRe: Decryption algorithm Pin
AspDotNetDev2-Feb-10 16:57
protectorAspDotNetDev2-Feb-10 16:57 
GeneralRe: Decryption algorithm [modified] Pin
Not Active2-Feb-10 11:58
mentorNot Active2-Feb-10 11:58 
Questionproblem of socket programming with local ip Pin
mehrdad3332-Feb-10 8:38
mehrdad3332-Feb-10 8:38 
AnswerRe: problem of socket programming with local ip Pin
Jimmanuel2-Feb-10 9:29
Jimmanuel2-Feb-10 9:29 
QuestionMs Access reports saving to File system in C# Pin
montu33772-Feb-10 8:34
montu33772-Feb-10 8:34 
AnswerRe: Ms Access reports saving to File system in C# Pin
Mycroft Holmes2-Feb-10 12:01
professionalMycroft Holmes2-Feb-10 12:01 
GeneralBluetooth programming Pin
Jamal Abdul Nasir2-Feb-10 8:31
Jamal Abdul Nasir2-Feb-10 8:31 
GeneralRe: Bluetooth programming Pin
Ennis Ray Lynch, Jr.2-Feb-10 8:35
Ennis Ray Lynch, Jr.2-Feb-10 8:35 
GeneralRe: Bluetooth programming Pin
Giorgi Dalakishvili2-Feb-10 23:05
mentorGiorgi Dalakishvili2-Feb-10 23:05 
QuestionWhen To Use 'this' in C# Pin
Matt U.2-Feb-10 8:15
Matt U.2-Feb-10 8:15 
AnswerRe: When To Use 'this' in C# Pin
Abhinav S2-Feb-10 8:21
Abhinav S2-Feb-10 8:21 
AnswerRe: When To Use 'this' in C# Pin
OriginalGriff2-Feb-10 8:25
mveOriginalGriff2-Feb-10 8:25 
GeneralRe: When To Use 'this' in C# Pin
Matt U.2-Feb-10 10:55
Matt U.2-Feb-10 10:55 
AnswerRe: When To Use 'this' in C# Pin
Ennis Ray Lynch, Jr.2-Feb-10 8:25
Ennis Ray Lynch, Jr.2-Feb-10 8:25 
GeneralRe: When To Use 'this' in C# Pin
Kevin McFarlane2-Feb-10 10:32
Kevin McFarlane2-Feb-10 10:32 
GeneralRe: When To Use 'this' in C# Pin
DaveyM692-Feb-10 12:28
professionalDaveyM692-Feb-10 12:28 
Kevin McFarlane wrote:
A lot of MS's generated code uses this.xxx


A FormX.Designer.cs is full of it. I guess the principles are:

1. In a container (such as a form) that holds many different objects, explicitly stating the object that you are using a method or property of is probably good practice and leaves no room for ambiguity.

2. It allows for parameters and fields to have the same name (much more likely to occur in auto generated code). If you always access the field with this then there will be no issues in this situation.

Personally, I only use it in my hand written code in case 2 and only where needed.

Dave

Tip: Passing values between objects using events (C#)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus)

GeneralRe: When To Use 'this' in C# Pin
Kevin McFarlane3-Feb-10 0:08
Kevin McFarlane3-Feb-10 0:08 
GeneralRe: When To Use 'this' in C# Pin
Mycroft Holmes2-Feb-10 12:08
professionalMycroft Holmes2-Feb-10 12:08 
GeneralRe: When To Use 'this' in C# Pin
AspDotNetDev2-Feb-10 17:05
protectorAspDotNetDev2-Feb-10 17:05 

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.