LA.NET [EN]

July, 2011Archive

Jul 27

Getting started with delegates – part III

Posted in .NET, Basics, C#       Comments Off on Getting started with delegates – part III

I’ve ended the previous post by saying what we can chain several method calls and that is what we’ll see in this post. With chaining, we can combine several delegates so that calling one of them ends up invoking all of them. A quick example is the best way to see this feature in action […]

Read the rest of this entry »

Jul 26

As we’ve seen in the previous post, delegates are really easy to use: you create a new delegate definition and then instantiate it through the new operator, passing it a compatible method reference. However, there’s a lot more going on behind the scenes and that’s what we’ll start seeing in this post. The first thing […]

Read the rest of this entry »

Jul 26

Getting started with delegates–part I

Posted in .NET, Basics, C#       Comments Off on Getting started with delegates–part I

If you’re an experienced Windows developer, then you know that Windows has always relied on callback methods/functions for doing several things (ex.: window procedures). In unmanaged code, this was typically achieved through the use of callback functions which, in practice, referenced only a memory address that “had” some code which should be executed when something […]

Read the rest of this entry »

Jul 21

Getting started with attributes – part V

Posted in .NET, Basics, C#       Comments Off on Getting started with attributes – part V

After all, I’ve decided to write another post about custom attributes. In the last post, I’ve mentioned the use of the CustomAttributeData type. Since I’ve received a couple of questions about its use, I thought it would be a good idea to show an example of how one can use this class to check for […]

Read the rest of this entry »

Jul 18

The wrapper object trick

Posted in Javascript       Comments Off on The wrapper object trick

Whenever people ask me what I think about the JavaScript wrapper objects (ex.: String, Number, etc.), I tend to tell them that it’s better to forget that they exist and simply use the literal values (and simply let the runtime perform the conversions between literal an wrapper object automatically and whenever it’s needed). I tend […]

Read the rest of this entry »

Jul 18

Getting started with events – part IV

Posted in .NET, Basics, C#       Comments Off on Getting started with events – part IV

Now that we already know how to create new custom attributes and how to restrict its use, it’s time to wrap up this series with a final post that shows how to rely on custom attributes to change the behavior of your code at runtime. One of the first things you’ll need to do (if […]

Read the rest of this entry »

Jul 04

Getting started with attributes in .NET – part III

Posted in .NET, Basics, C#       Comments Off on Getting started with attributes in .NET – part III

After another long blogging pause (for a good cause, I must say!), it’s time to go back to our .NET attribute series. In the previous post, we’ve starting looking at how we can build new custom attributes. We’ve already met several restrictions (ex.: inherit from the Attribute base class, limitations applied to the types used […]

Read the rest of this entry »