public new static Element Deserialize(XElement X) { Coord a = Coord.Parse(X.Attribute("A").Value); Coord b = Coord.Parse(X.Attribute("B").Value); if (a == b) { return new Symbol(new Warning(X, "Zero length wire.")) { Position = a } } ; return(new Wire(a, b)); }
public new static Symbol Deserialize(XElement X) { Component C; try { C = Component.Deserialize(X.Element("Component")); } catch (Exception Ex) { C = new Error(X, Ex.Message); } return(new Symbol(C) { Position = Coord.Parse(X.Attribute("Position").Value), Rotation = int.Parse(X.Attribute("Rotation").Value), Flip = bool.Parse(X.Attribute("Flip").Value), }); }