I forgot casting mechanism when i encounter it :) . So can u make me remember it again ? Because i开发者_如何学Got looks not acceptable for me at the moment.
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);
精彩评论