Thursday 23 April 2009

Attaching Inline Event using Lambda

textBox.TextChanged += (o, e) => { SomeMethod(); };

Friday 17 April 2009

Coalesing in C#

// numberAfterCoalescing will be equals to 100 in this case
int? number = null; int numberAfterCoalescing = (number ?? 100);

Tuesday 14 April 2009

Dynamic Class Instantiation

public void DynamicInstantiation(string fullname)

{  

    // Assign the fully qualified name to a string variable  

    // fullname = "Namespace.ClassName";  

    // Or to get the namespace dynamically  

    // string fullname = object.GetType().Namespace + ".ClassName";   

    // Then Create the object  

    SampleClass dynclass = (SampleClass)System.Activator.CreateInstance(Type.GetType(fullname));

}

Free e-books

Microsoft has published a free ebook on Silverlight 3 Beta
Silverlight 2.0, LINQ, ASP.NET 3.5 free E-Books are also available here. MS SQL Server 2008 free E-Book available here. ASP.NET MVC Tutorial with Sample application available here : Microsoft Learning Snacks : here .
Download the cheatsheet for Visual Studio C# 2008.

Wednesday 1 April 2009

MIX 09 Sessions

MIX 09 Videos available online at http://sessions.visitmix.com/