Some more on the implicit operator

22 May 2008 Elaborating on my past post on the implicit operator in C#, here some additional information to round this thing up. Can you inherit the implicit operator(s)? No, you cannot. Within a type you could write as many implicit operator implementations as you like, but any of the two types referenced...

A simple way to start your code in a different AppDomain

20 May 2008 You may know that AppDomains in the .Net Framework are comparable to processes in that they provide an isolated execution context for the instructions executed by the CLR. However, they are also quite lightweight and what is more, you can have more than one inside an actual OS process in...

Lazy instantiation one-liner of instance fields with the coalesce operator

13 May 2008 It is hardly worth blogging, but… Did you know that the return value of an assignment is the assignment? i.e. class Person { public string Name; } ... Person p; Console.WriteLine((p = new Person()).Name); And did you know there is a coalesce operator since .NET 2.0 that will return the...

WPF + INotifyPropertyChanged Proxy = Epic Fail!

08 May 2008 It seemed a straightforward thing to do. Sending property changed events when a property is changed is repetitive boilerplate code that can be factored out into an aspect of your system’s behaviour. This can be done with a proxy generator library like the Castle’s **DynamicProxy2 **(See my first attempts playing...

Is it alright to send messages to null references?

04 May 2008 This is a non-question, you may say, and even at the end of this post you will notice that it is still true that you cannot call anything on a null reference. But let me explain… Foundation for this post are the following blog entries… Raising events using extension methods...