Quantcast
Channel: C# 4 – theburningmonk.com
Browsing index pages (10 articles)

Image may be NSFW.
Clik here to view.

.Net Tips – Use LINQ to create pairs of adjacent elements from a collection

Suppose you have an array of numbers, say, [1, 3, 5, 7, 9, …], and you want to pair each element up with its neighbour in the array, e.g. [[1, 3], [3, 5], [5, 7], [7, 9], …]. Sure, you can iterate...

View Article


Image may be NSFW.
Clik here to view.

.Net Tips – Make sure the runtime types match when combining delegates

In C#, it’s possible to combine two delegates, A and B to create a new multicast delegate, C:   When the multicast delegate is executed, the combined delegates are executed in order as you can see from...

View Article


Image may be NSFW.
Clik here to view.

Things I didn’t know about expando objects

I found out two interesting things about the ExpandoObject class introduced in C# 4 this bank holiday weekend: 1. you can specify custom events on them 2. it implements the INotifyPropertyChanged...

View Article

Image may be NSFW.
Clik here to view.

Turn ExpandoObject into static type

As many others have shown, the new ExpandoObject introduced in C# 4 can be pretty useful in some scenarios. However, on the odd occasion when you want to convert an ExpandoObject to a static type you...

View Article

Image may be NSFW.
Clik here to view.

IDictionary to ExpandoObject extension method

As you know, the ExpandoObject class implements the IDictionary<string, object> interface, so if you have an ExpandoObject you can easily cast it to an IDictionary<string, object> but...

View Article


.Net Tips – Use LINQ to create pairs of adjacent elements from a collection

Tweet Suppose you have an array of numbers, say, [1, 3, 5, 7, 9, …], and you want to pair each element up with its neighbour in the array, e.g. [[1, 3], [3, 5], [5, 7], [7, 9], …]. Sure, you can...

View Article

.Net Tips – Make sure the runtime types match when combining delegates

Tweet In C#, it’s possible to combine two delegates, A and B to create a new multicast delegate, C:   When the multicast delegate is executed, the combined delegates are executed in order as you can...

View Article

Things I didn’t know about expando objects

Tweet I found out two interesting things about the ExpandoObject class introduced in C# 4 this bank holiday weekend: 1. you can specify custom events on them 2. it implements the INotifyPropertyChanged...

View Article


Turn ExpandoObject into static type

Tweet As many others have shown, the new ExpandoObject introduced in C# 4 can be pretty useful in some scenarios. However, on the odd occasion when you want to convert an ExpandoObject to a static type...

View Article


IDictionary to ExpandoObject extension method

Tweet As you know, the ExpandoObject class implements the IDictionary<string, object> interface, so if you have an ExpandoObject you can easily cast it to an IDictionary<string, object> but...

View Article
Browsing index pages (10 articles)


Latest Images