c#

FacebookTwitter
LINQ

http://dvanderboom.wordpress.com/2008/03/15/treet-implementing-a-non-binary-tree-in-c/ Download the Source [This is the first article in a series of intelligent data structures, which is continued here with KeyedList .] I’ve always thought it was odd that the .NET Framework never shipped with a Tree or Tree<T> class in its collection namespaces. Most of the other classic data structures are there: List, Dictionary, Stack, Queue, and so on. Where then is Tree<T>? I have no idea, but finding myself in need of one, I decided to build one, and in doing so realized that it was a little trickier than I first imagined it would be.

Tree<T>: Implementing a Non-Binary Tree in C# « Critical Development

Asynchronous Programming - Easier Asynchronous Programming with the New Visual Studio Async CTP

Imagine what the world would be like if people worked the same way as computer programs: void ServeBreakfast(Customer diner) { var order = ObtainOrder(diner); var ingredients = ObtainIngredients(order); var recipe = ObtainRecipe(order); var meal = recipe.Prepare(ingredients); diner.Give(meal); } Each subroutine can, of course, be broken down further; preparing the meal might involve heating pans, cooking omelets and toasting bread. Were humans to perform these sorts of tasks like typical computer programs, we’d carefully write down everything as sequences of hierarchical tasks in a checklist and obsessively ensure that each job was complete before embarking on the next. A subroutine-based approach seems reasonable—you can’t cook the eggs before you get the order—but in fact it both wastes time and makes the application appear unresponsive. It wastes time because you want the bread to be toasting while the eggs are frying, not after the eggs are done and getting cold. http://msdn.microsoft.com/en-us/magazine/hh456401.aspx
http://msdn.microsoft.com/en-us/library/f7ykdhsy(v=vs.71).aspx

Reflection Overview

The common language runtime loader manages application domains . This management includes loading each assembly into the appropriate application domain and controlling the memory layout of the type hierarchy within each assembly. Assemblies contain modules, modules contain types, and types contain members. Reflection provides objects that encapsulate assemblies, modules, and types. You can use reflection to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object.
You have probably already heard about the new dynamic feature in C# 4.0 and how it is used to support COM interop. If you haven't, I strongly recommend reading the following MSDN articles: Using Type dynamic and How to: Access Office Interop Objects by Using Visual C# 2010 Features . Well, where else can you use this new feature? What are the use cases? Where does dynamic dispatch work better than static typing? The quick answer is that whenever you see syntax like myobject.GetProperty("Address") , you have a use case for dynamic objects. http://blogs.msdn.com/b/csharpfaq/archive/2009/10/01/dynamic-in-c-4-0-introducing-the-expandoobject.aspx

Dynamic in C# 4.0: Introducing the ExpandoObject - C# Frequently Asked Questions

http://code.google.com/p/impromptu-interface/

impromptu-interface - ImpromptuInterface: Static interface to dynamic implementation (duck casting). That and more using the DLR.

C# 4.0 (.net & silverlight) framework to allow you to wrap any object (static or dynamic) with a static interface even though it didn't inherit from it. It does this by emitting cached dynamic binding code inside a proxy. By expanding on the DLR plumbing used to implement this library, it has grown to support more general dynamic implementations. See Usage for full examples of all features.

Unusual uses of ExpandoObject in C# 4 : Reed Copsey, Jr.

http://reedcopsey.com/2009/11/06/unusual-uses-of-expandoobject-in-c-4/ Posted by Reed on Friday, November 6, 2009 · 7 Comments One of the new features in C# 4 is the use of the dynamic keyword , allowing types to be defined with no regard to static type checking. Although many of the use cases for this revolve around interoperability, especially with dynamic languages and COM, there are types in the framework designed to make this available for use internally in C# programs as well. The simplest dynamic implementation in .NET 4 is System.Dynamic.ExpandoObject . Most of the examples for using ExpandoObject basically demonstrate a replacement for a Hashtable or Dictionary<string,object> , but with a “nicer” syntax. For example, Alexandra Rusina blogged about using ExpandoObject , showing how you can use this to simplify access to XML documents.

URL Routing in ASP.NET 4

By Scott Mitchell Introduction In the .NET Framework 3.5 SP1, Microsoft introduced ASP.NET Routing, which decouples the URL of a resource from the physical file on the web server. http://www.4guysfromrolla.com/articles/012710-1.aspx
http://www.4guysfromrolla.com/articles/051309-1.aspx By Scott Mitchell Introduction ASP.NET MVC is a Microsoft-supported framework for creating ASP.NET applications using a M odel- V iew- C ontroller pattern.

Using ASP.NET Routing Without ASP.NET MVC

Problem You have multiple objects that need to observe modifications to objects that implement IDictionary<K,V> . When an item is added or modified in the dictionary-based collection, each of these observer objects should be able to vote to allow or disallow the action. In order for an action to be allowed to complete, all observer objects must state if they are vetoing the action. If even one observer object votes to disallow the action, the action is prevented. Solution http://msdn.microsoft.com/en-us/library/orm-9780596516109-03-09.aspx

Chapter 9. Delegates, Events, and Lambda Expressions

http://msdn.microsoft.com/en-us/library/bb397687.aspx

Lambda Expressions (C# Programming Guide)

Many Standard query operators have an input parameter whose type is one of the Func < T, TResult > family of generic delegates. The Func < T, TResult > delegates use type parameters to define the number and type of input parameters, and the return type of the delegate. Func delegates are very useful for encapsulating user-defined expressions that are applied to each element in a set of source data. For example, consider the following delegate type:

LINQ TO XML

Getting Started Walking Through a Silverlight Application Take a tour of the XAML and Javascript generated by an application template that's installed with the Silverlight SDK. Organizing XAML Assets Learn how to organize XAML assets in Expression Design and Expression Blend to maximize developer efficiency.

What is that IGrouping result returned from group by LINQ queries?

I dont know how much you people use LINQ but for me it was like a blessing. Since I figured out how helpful it is I never really looked back. But this post is not about obvious usefulness of LINQ, everyone should know that by now!!! I would like to clarify some exotic details on the results we get from group by queries with LINQ and explain a little bit more on that infamous IGrouping collection.
blogs

In the soon-to-be-released .NET 4.0 framework and Visual Studio 2010 we are going to get a plethora of new tools to help us write better multi-threaded applications. One of these tools is a new namespace within the System.Threading namespace which is called "Tasks". The Tasks in System.Threading.Tasks namespace are a method of fine grained parallelism, similar to creating and using threads, but they have a few key differences.

.NET 4.0 and System.Threading.Tasks