示例#1
0
        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);
        }
 public MasterAssembly(string path)
     : base(path)
 {
     masterinfo = XMLAssembly.CreateFromFile (path);
     if (masterinfo == null)
         throw new ArgumentException ("Error loading masterinfo from " + path);
     attributes = MasterUtils.GetAttributes (masterinfo.attributes);
 }
 public MasterAssembly(string path)
     : base(path)
 {
     masterinfo = XMLAssembly.CreateFromFile(path);
     if (masterinfo == null)
     {
         throw new ArgumentException("Error loading masterinfo from " + path);
     }
     attributes = MasterUtils.GetAttributes(masterinfo.attributes);
 }
示例#4
0
		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;
		}