Browse by Tags
Sorry, but there are no more tags available to filter with.
-
-
If you already know partial classes, you should take a look at partial method. This is far from basic c# code, but can be useful in some cases. -f. ref.: http://community.bartdesmet.net/blogs/bart/archive/2007/07/28/c-3-0-partial-methods-what-why-and...
-
-
Check out the yield statement when implementing the IEnumarable interface. You can interestingly return each values, and continue the to process... like a multiple “return” -f. ref: http://msdn.microsoft.com/en-us/library/9k7k7cf0.aspx
-
-
From MSDN: “As a rule, when you use an IDisposable object, you should declare and instantiate it in a using statement.” Simple. -f. ref: http://msdn.microsoft.com/en-us/library/yh598w02.aspx
-
-
Is use this. when calling local properties, so that the code is self describing. this. explicitly explain that you are accessing a class local property by the property accessor, and _variable when accessing the variable itself. -f.
-
-
In my opinion, everything should be a file, when it’s defined on the namespace. But why? Simple: maintenance. You want a class? an enum? a eventargs or an handler? check out the file corresponding to the name of it. -f.
-
-
I always create property assessors for objects. But why? Maybe just in case I need them later. Now, with VS 2008 there is a new feature, automatic properties. Check them out, it will save you time. -f. ref: http://weblogs.asp.net/scottgu/archive/2007...
-
-
When it’s time to isolate code into component, a good way to do it easily is to remove namespaces from classes and references from assembly… Removing Windows.Form remove the entire Windows Form layer from the class, and separate the component. Removing...
-
-
Overriding ToString() is always a good idea... but why? When it’s time to debug, you can, on all entities get a good string representation of your object without having to imagine something... also, is it a good idea is to have a constructor that requires...
-
-
(Almost) everybody is using them, but did you even think why? There is many reasons why using them. The main one, is to control who, when and how caller are accessing the value. You can also validate data before setting it, or expose data, loaded on demand...