Debugging C# 3.0 Part II

Overview In the last article I covered the “results view” for lazy evaluated collections like Queries/Enumerable and the use of extension methods in the watch and immediate window. For completeness I will cover stepping, range variables, anonymous types and Xlinq support and this will lead us into the SP1 work for debugging. Stepping Stepping has…

3

Extension methods Interoperability between languages

Extension methods written in C# can be imported and called with Extension method semantics in VB and vice versa. This is possible since me decorate the assemblies , types and methods in the same manner. Using the Attribute [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)] public sealed class ExtensionAttribute : Attribute { } This should be a special note…

4

Conversion rules for Instance parameters and their impact

Overview: Instance parameter is the first parameter of an extension method and has the “this” parameter modifier. I discuss special conversion rules for them and some of the things that users of extension methods might encounter. Consider the code bellow using System;using System.Linq;namespace TestExtensions{    class Program    {        static void Main()        {            0.Foo();    // 1            0f.Foo();           …

2

Debugging and Delayed Execution in C# 3.0

Overview: C# 3.0 added a few constructs like queries which are delay executed. This means that they are not actually executed until the results of the query are required. Debugging some of them can seem strange since one can’t step in to the Query where its created but only where its enumerated, like in a…

1

Debugging Features in C# 3.0 Part 1

Overview C# 3.0 introduces many new constructs and opens entirely new ways of thinking and developing code. In this article I will talk about the new debugging features that make it easy to see the running code and better understand it. In my experience one spends as much time writing the initial code as debugging it later….

8

Learning C#

I was recently asked by a developer “I know C++ how do i get into C# and .Net”. If you want to understand the language design and its inner workings I would suggest The C# programing Language. If you want to use .Net and C# try Practical .Net and C#.   For the New feature in C#3.0…

4

Extension methods and Curried Delegates

Delegates  Since Extension methods behave like instance method it makes sense that we should be able to create delegates that would accept the instance method signature, to this end we have included Adding an Extension Methods to delegate invocation List    Extension methods can now be used like an instance methods when being added to a delegate…

8

Extension method Binding and Error reporting

Overview: Extension methods are static methods that are bound with instance semantics. In this article i will give a brief overview of the various steps involved in binding a extension methods. Finally this will prepare the way to discuss the error reporting for extension methods and how these error messages can be used to diagnose the problem at hand. All…

3

Extension methods in C#

Overview  Extension methods are a new feature for C# 3.0 and I had the opportunity to implement them in the Compiler. These methods can then be called with instance syntax on any object that is convertible(see convertibility section for details) to the first param of the method. Validation  Extension methods are defined in C# as static class…

18

Extension methods in C#

Overview  Extension methods are a new feature for C# 3.0 and I had the opportunity to implement them in the Compiler. These methods can then be called with instance syntax on any object that is convertible(see convertability section for details) to the first param of the method. Validation  Extension methods are defined in C# as static class…

0