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