Welcome to Manicprogrammer Sign in | Join | Help

Rediscovering the Obvious

An occasional journey through one man's perspectives as he fumbles along in the footsteps of many great men.
Linq to XML follow up - how the magic works

If you're curious how the XNamespace works, just do a "Go to Definition" in VS and you'll see the declarations, the key aspects are:

public static bool operator !=(XNamespace left, XNamespace right);
public static XName operator +(XNamespace ns, string localName);
public static bool operator ==(XNamespace left, XNamespace right);
public static implicit operator XNamespace(string namespaceName);

The last one is what allows me to write code like this and have it compile... note the lack of a constructor:

            XNamespace ns = "http://schemas.microsoft.com/winfx/2006/xaml";

 

 

Published Wednesday, February 27, 2008 1:46 PM by willeke

Filed under: ,

Comments

No Comments

Anonymous comments are disabled