| 04.21.05
Generics in C# Generics are the most useful C# 2.0 language extensions, beside Anonymous methods, Iterators, Partial types And Nullable types.
What are generics?
Generics permit classes, structs, interfaces, delegates, and methods to be parameterized by the types of data they store and manipulate.
Why generics?
To well know the useful of generics lets examine the following code:-- Read The Whole Article
Custom ShortDate type (struct: Icomparable) Here it is a custom C#.NET Date type (struct) that will help you deal with converting to and from strings. The struct implements the IComparable interface and overrides the ToString, Equals and GetHashCode() functions.
In my work I use short dates all the time so this struct has only 3 members: day, month and year. It is realy easy to extend the struct to full datetime, just drop a message to my blog if you need it. (http://www.alephdev.blogspot.com) Read The Whole Article
More on Handling Basic Data Types Have you ever wanted to learn how basic types of C++ variables interact in complex situations? Ivor Horton explains this, and also describes some interesting features of C++. This article is from chapter 3 of Ivor Horton's Beginning ANSC C++ The Complete Language (Apress, 2004; ISBN 1590592271).
IN THIS CHAPTER, I expand on the types that I discussed in the previous chapter and explain how variables of the basic types interact in more complicated situations. I also introduce some new features of C++ and discuss some of the ways that these are used. Read The Whole Article
Use XML to document C# code (Part 1). Xml is one of the best things happened to Web world and if you are familiar with XML then you are going to love ability to use it for documenting C# code. Advantage ? It lets you generate documentation from your C# code. For those who know Java, its almost the same feature as JavaDoc, personally I think its only better. Reason? It uses XML and if used with XSLT you can do wonders with the way your documentation looks with no hard work.
So how does it work? Basically you can write comments in XML format in your C# code and then C sharp compiler allows you to generate XML file containing the documentation when you compile the code. Lets see how does this all really works. Read The Whole Article |