Dynamic in C# II: Basics

Last time, we began to dive into dynamic binding in C# and what happens through the pipeline. This time, we’ll take a simple scenario and pick apart the details of what happens under the covers, both during compile time and runtime. We can break down what the compiler does into three parts: type and member…

15

Dynamic in C#

The other day I was playing around with some office code, and I found myself writing a lot of code much like the following sample that Anders used at his PDC talk: static void Main(string[] args) { var xl = new Excel.Application(); ((Excel.Range)xl.Cells[1, 1]).Value2 = "Process Name"; ((Excel.Range)xl.Cells[1, 2]).Value2 = "Memory Usage"; } As you…

23