Example #1
0
        public static Schematic Load(string FileName, ILog Log)
        {
            XDocument doc = XDocument.Load(FileName);
            Schematic S   = Schematic.Deserialize(doc.Root, Log);

            Log.WriteLine(MessageType.Info, "Schematic loaded from '" + FileName + "'");
            S.LogComponents();
            return(S);
        }
Example #2
0
        public static Schematic Deserialize(XElement X, ILog Log)
        {
            Schematic s = new Schematic(Log);

            s.Elements.AddRange(X.Elements("Element").Select(i => Element.Deserialize(i)));
            s.Circuit.Name        = Value(X.Attribute("Name"));
            s.Circuit.Description = Value(X.Attribute("Description"));
            s.Circuit.PartNumber  = Value(X.Attribute("PartNumber"));
            return(s);
        }
Example #3
0
 public static Schematic Deserialize(XElement X, ILog Log)
 {
     Schematic s = new Schematic(Log);
     s.Elements.AddRange(X.Elements("Element").Select(i => Element.Deserialize(i)));
     s.Circuit.Name = Value(X.Attribute("Name"));
     s.Circuit.Description = Value(X.Attribute("Description"));
     s.Circuit.PartNumber = Value(X.Attribute("PartNumber"));
     return s;
 }