samng

Stories submitted by samng

The Pain of deploying Primary Interop Assemblies(blogs.msdn.com)

submitted by samngsamng(135) 2 years, 4 months ago

Alright, first of all, what are Primary Interop Assemblies (PIAs), and why am I devoting an entire post to the pains caused by deploying these things? And secondly, how do they relate with what we’ve been talking about thus far? read more...

add a comment |category: |Views: 10

tags: another

Com interop in C# 4.0: Indexed Properties (blogs.msdn.com)

submitted by samngsamng(135) 2 years, 6 months ago

One of the things I love about my job is that I get to make people happy. How do I do that? By giving them what they want of course! One of the things I don’t like so much about my job is going back on a decision that we made before, and having to revert some of the behavior. Well, we’ve been talking about COM interop in C# 4.0, and are now in the thick of things. Today we’ll chat about a feature which many people have asked for in the past, but we’ve stayed away from until now – Indexed Properties. read more...

add a comment |category: |Views: 22

tags: another

Com Interop in C# 4.0(blogs.msdn.com)

submitted by samngsamng(135) 2 years, 11 months ago

These remaining features that we’ll chat about all have a strong tie to the COM world – that is, the features themselves require that the objects that you’re playing with are COM objects. How do we determine that? Well, you’ll soon find out! read more...

add a comment |category: |Views: 44

tags: another

Named and Optional arguments - Ties and Philosophies(blogs.msdn.com)

submitted by samngsamng(135) 3 years, 1 month ago

We’re almost done with our chat about named and optional arguments. We’ve covered what the feature is about, and covered overload resolution in more detail. This time I want to do a quick wrap up of our discussion by talking about the tie breaker rules, and then I want to give a bit of background and philosophy behind why we’re electing to do this feature now, instead of several releases ago when it was first considered. read more...

add a comment |category: |Views: 3

tags: another

Named Arguments and Overload Resolution(blogs.msdn.com)

submitted by samngsamng(135) 3 years, 1 month ago

Last time we talked about the basics of named arguments, optional arguments, and default values. From here on out, I’m just going to refer to the whole feature group as “named and optional arguments” – it’s just too much typing otherwise (we actually just refer to the feature as N&O internally). Let’s now dive a little deeper into how overload resolution works for the feature. read more...

add a comment |category: |Views: 7

tags: another

Named arguments, optional arguments, and default values(blogs.msdn.com)

submitted by samngsamng(135) 3 years, 3 months ago

C# 4.0 introduces the concept of optional parameter values into the language. Now, this has been a controversial subject in the past, and we have had many requests for the feature, but have traditionally stayed away from it. So, why now? Well, before we get into the philosophy of why we decided to add it this time (which we will! I promise!), first lets discuss the feature itself. read more...

1 comment |category: |Views: 24

tags: another

DYNAMIC IN C#(blogs.msdn.com)

submitted by samngsamng(135) 3 years, 5 months ago

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"; } read more...

add a comment |category: |Views: 20

tags: another

DYNAMIC IN C# II: BASICS(blogs.msdn.com)

submitted by samngsamng(135) 3 years, 5 months ago

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 declarations with dynamics (ie methods that return dynamic), binding and lookup, and emitting. We'll deal now with the binding aspects of dynamic. read more...

add a comment |category: |Views: 9

tags: another

DYNAMIC IN C# III: A SLIGHT TWIST(blogs.msdn.com)

submitted by samngsamng(135) 3 years, 5 months ago

Last time we dealt with the basics of dynamic binding. This time, we'll add a small twist. read more...

add a comment |category: |Views: 5

tags: another

DYNAMIC IN C# IV: THE PHANTOM METHOD(blogs.msdn.com)

submitted by samngsamng(135) 3 years, 5 months ago

Yes, this does sound like a Star Wars movie, but no, I'm not a Star Wars geek that just likes to pull lines from my favorite movies (though I rather enjoyed Star Wars). This post will deal with what we've coined "the phantom method". It's the method that the static compiler will bind to during the initial binding phase when it recognizes that the invocation its trying to bind needs to be bound dynamically and cannot be resolved statically. read more...

add a comment |category: |Views: 31

tags: another

DYNAMIC IN C# V: INDEXERS, OPERATORS, AND MORE!(blogs.msdn.com)

submitted by samngsamng(135) 3 years, 5 months ago

Now that we're all experts in how dynamic invocations work for regular method calls, lets extrapolate a bit and take a look at how those basic concepts apply to other dynamic operations... read more...

add a comment |category: |Views: 9

tags: another

Virtual Events in C#(blogs.msdn.com)

submitted by samngsamng(135) 4 years, 6 months ago

One of the things that the language designers considered when designing the C# language was the ability to notify external callers of certain events happening. To solve this problem, they (surprise surprise) introduced the event construct. One of the oddities in the design however, comes in the form of virtual events. read more...

add a comment |category: |Views: 165

tags: another

Local variable scoping in C#(blogs.msdn.com)

submitted by samngsamng(135) 4 years, 6 months ago

In my previous post, Compiler-generated scopes for local variable declarations, I briefly touched on the issue of multiple meanings applied to the same name. In this post, I'll aim to flush out the compiler's rules with regards to binding names in their local scopes. read more...

add a comment |category: |Views: 4

tags: another