|
|
Browse by Tags
All Tags » C#
Showing page 1 of 2 (15 total posts)
-
The new interesting feature of C# 3.0 is Partial Methods. Basically name “Partial” is not accurate for this feature. First what comes to head is an idea that method is implemented in separate places like “Partial” classes are but this is actually not true.
Looks like a “virtual”
Partial method gives ability to specify the usage of method in ...
-
Previous materials of C# 3.0 Feature series:
Part 1 - C# 3.0 Features. Part I: Auto Property
Part 2 - C# 3.0 Features. Part II: Object and Collection Initialization
Part 3 - C# 3.0 Features. Part III: The var keyword
''Dynamic'' Classes
Anonymous Type is basically the C# way how we can dynamically create, populate and use a class ...
-
Previous materials of C# 3.0 Feature series:
Part 1 - C# 3.0 Features. Part I: Auto Property
Part 2 - C# 3.0 Features. Part II: Object and Collection Initialization
“var” keyword
During the local variable declaration we have to explicitly specify the type even if the variable doesn’t have any value yet. The “var” expression brings ...
-
Originally I was not planning to post this subject until I spent hours for hunting some ghost JavaScript code. Problem was in generating custom JavaScript inside of WebControl.
Basically this is not about ''How'' to generate JavaScript code but ''When''. Unfortunately I faced to this problem several times and all the time it was a cause for some ...
-
Theory
Explicit interface implementation helps to ensure that user can use methods define by a given interface using by correct interface reference.
Illustration
Lets say we have to build a motherboard which contains a memory slot and a slot for PCI Express card. It is also important for us to get access to each of its parts and ...
-
Subject
As we know StringBuilder builds strings faster than + operator or String.Concat() method. Also StringBuilder with specified capacity performs faster than with default one.
But how fast StringBuilder is?
I created simple application to measure performance of different approaches of string concatenations. ...
-
Technorati tags: .Net, C#, CRL, String, Compare, Equals, CompareTo, Intern
.Net Framework gives us several tools how to compare two strings. We can use String.Equals(), String.Compare(), StringCompareTo(), etc. What we are going to discover now it is what is the performance impact of each of this methods.
Let's first take a ...
-
Conversion in .Net
As we know there are two types of conversion exist in .Net: Explicit and Implicit
The difference allows programmer to use conversion technic in a different way regarding context it used in.
int b = 3;//explicit conversion of int to shortshort a = (short)b;
short c = 13;//implicit conversion of short to intint k = ...
-
.Net Framework 2.0 brought us ability of having nullable value type variables. Maybe it sounds unusually but there are cases where we could use this feature. To make it happen we have to put ''?'' mark operator after the type, like this:
bool? booleanvalue = null;
int? integervalue = null;
short? ...
-
Probably you know about the IComparer and IComparable interfaces which bring us ability to sort items inside of the collection. I would like to talk about them as I know a lot of developers getting confused during implementation sorting functionality.
One dimensional sorting, IComparable.
IComparable interface allow object to be ...
1
|
|
|