views:

107

answers:

1

I forgot casting mechanism when i encounter it :) . So can u make me remember it again ? Because it looks not acceptable for me at the moment.

+2  A: 

XName has an implicit conversion from string. From MSDN:

Creating an XName Object

XName does not contain any public constructors. Instead, this class provides an implicit conversion from String that allows you to create an XName. The most common place you use this conversion is when constructing an element or attribute: The first argument to the XElement constructor is an XName. By passing a string, you take advantage of the implicit conversion.

The declaration looks like this:

public static implicit operator XName(string expandedName);
Mark Byers
I didn't know implicit operator and how to use it.Detailed info is here http://msdn.microsoft.com/en-us/library/z5z9kes2(VS.71).aspx
Freshblood