开发者

XName x = "string"?

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜