LA.NET [EN]

June, 2011Archive

Jun 18

In the previous post, we’ve started looking at how we can use attributes to improve the metadata of a type. Even though we’ve looked at some attributes and seen how the C# compiler reduces the required typing by allowing us to skip the Attribute suffix, I didn’t really got into details about how attributes are […]

Read the rest of this entry »

Jun 17

Kinects à borliu no Facebook?

Posted in Trivia       Comments Off on Kinects à borliu no Facebook?

To celebrate the release of the new Kinect SDK beta, MS Portugal has launched a new context on the Kinect PT’s Facebook page. To enter the contest,  you need to live in Portugal and send a 140 chars message with an idea for creating something with the new SDK. The two most voted entries automatically  […]

Read the rest of this entry »

Jun 15

Getting started with attributes in .NET

Posted in .NET, Basics, C#, CLR       Comments Off on Getting started with attributes in .NET

We’ve already covered a lot of ground on the basics series…but guess what? There’s still a lot more to cover Today, we’ll start looking at how we can improve our .NET code with attributes. With attributes, we can add custom metadata to our types (and/or a type’s members). After adding extra information to a type […]

Read the rest of this entry »

Jun 12

Enums in .NET– part V

Posted in .NET, Basics, C#       Comments Off on Enums in .NET– part V

As we’ve seen, we’re limited quite limited when you need to define a new enumerated type: we can only specify the enum base type, the symbolic names and its associated values. That means that you can’t add new instance methods to an enum (which doesn’t really make sense because, as we’ve seen, enums are mapped […]

Read the rest of this entry »

Jun 09

OMG: Windows logo planted on Apple store in Germany

Posted in Trivia       Comments Off on OMG: Windows logo planted on Apple store in Germany

Fantastic! Never has an Apple store looked so sexy 🙂

Read the rest of this entry »

Jun 09

Enums in .NET – part IV

Posted in .NET, Basics, C#       Comments Off on Enums in .NET – part IV

In the last post, we’ve started looking at the static methods introduced by the Enum type. In this post, we’ll take a quick look at the instance methods provided by that type. Before going into the methods (well, to be precise, I should say method:)), I’d like to make a small detour. I’m not sure […]

Read the rest of this entry »

Jun 08

Enums in .NET – part III

Posted in .NET, Basics, C#       Comments Off on Enums in .NET – part III

Since a C# enum declaration is always “transformed” into a struct which inherits from the Enum type by the compiler, then we can reuse those instance methods inherited from Enum and the static ones which expect Enum parameters. In this post, we’ll be looking at the static methods defined by Enum. Lets start by introducing […]

Read the rest of this entry »

Jun 07

Enums in .NET – part II

Posted in .NET, Basics, C#       Comments Off on Enums in .NET – part II

In the previous post I’ve introduced the concept of enumerated type. As I’ve said, we can resort to an enumerated type to introduce several symbolic names/values pairs. As we’ve seen, enum are transformed into structs which extend the Enum type. During this transformation, the compiler ends up adding constants fields to the struct. By default, […]

Read the rest of this entry »

Jun 06

Enums in .NET – part I

Posted in .NET, Basics, C#       Comments Off on Enums in .NET – part I

I guess all .NET developers have already used enums (aka enumerated types) in applications, right? if this is true, then you probably know everything there is to know about enums, right? If that is the case, then I’d say you’re can probably miss this and the next couple of posts. On the other hand, if […]

Read the rest of this entry »

Jun 06

Wrapping up Nullable<T>

Posted in .NET, Basics, C#       Comments Off on Wrapping up Nullable<T>

Even though I’ve thought that the previous posts were enough for presenting the Nullable<T> type, the truth is that I’ve received a question about them from a friend of mine. Here’s what he was asking: If GetType returns T’s type, then how do you know you’re working with a nullable value type? Nice question…glad you’ve […]

Read the rest of this entry »