public LoadData ( |
||
node | ||
return | void |
public override void LoadData (XmlNode node)
{
if (node == null)
throw new ArgumentNullException ("node");
name = node.Attributes ["name"].Value;
version = node.Attributes ["version"].Value;
XmlNode atts = node.FirstChild;
attributes = new XMLAttributes ();
if (atts.Name == "attributes") {
attributes.LoadData (atts);
atts = atts.NextSibling;
}
if (atts == null || atts.Name != "namespaces") {
Console.Error.WriteLine ("Warning: no namespaces found!");
return;
}
namespaces = (XMLNamespace []) LoadRecursive (atts.ChildNodes, typeof (XMLNamespace));
}
public static XMLAssembly CreateFromFile(string file) { XmlDocument doc = new XmlDocument(); doc.Load(File.OpenRead(file)); XmlNode node = doc.SelectSingleNode("/assemblies/assembly"); if (node != null) { XMLAssembly result = new XMLAssembly(); try { result.LoadData(node); } catch (Exception e) { Console.Error.WriteLine("Error loading {0}: {1}\n{2}", file, e.Message, e); return(null); } return(result); } return(null); }