public static bool LoadFromFile(string fileName, out label obj) {
     System.Exception exception = null;
     return LoadFromFile(fileName, out obj, out exception);
 }
 /// <summary>
 /// Deserializes xml markup from file into an label object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output label object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out label obj, out System.Exception exception) {
     exception = null;
     obj = default(label);
     try {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }
 /// <summary>
 /// Deserializes workflow markup into an label object
 /// </summary>
 /// <param name="xml">string workflow markup to deserialize</param>
 /// <param name="obj">Output label object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string xml, out label obj, out System.Exception exception) {
     exception = null;
     obj = default(label);
     try {
         obj = Deserialize(xml);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }
 public static bool Deserialize(string xml, out label obj) {
     System.Exception exception = null;
     return Deserialize(xml, out obj, out exception);
 }
        private void CreateWireSegment(Port port, Eagle.segment segment_obj)
        {
            // create two short wire segments: 1. from src pin to, and 2. to dst pin
            // TODO: create vertical segments for vertical pins (or rotated symbols)
            var wire_obj = new Eagle.wire();
            var rot = port.Impl.Attributes.EDASymbolRotation;
            double x1 = port.CanvasX;
            double y1 = port.CanvasY;
            double x2 = x1;
            double y2 = y1;
            if (rot.Equals("R90") || rot.Equals("90"))
                y2 -= netLength; // 90 pointing down
            else if (rot.Equals("R270") || rot.Equals("270"))
                y2 += netLength; // 270 pointing up
            else if (rot.Equals("R180") || rot.Equals("180"))
                x2 += netLength; // 180 going right
            else
                x2 -= netLength; // 0 going left

            wire_obj.x1 = x1.ToString("F2");
            wire_obj.y1 = y1.ToString("F2");
            wire_obj.x2 = x2.ToString("F2");
            wire_obj.y2 = y2.ToString("F2");
            wire_obj.layer = netLayer;
            wire_obj.width = wireWidth;
            segment_obj.Items.Add(wire_obj);

            var label_obj = new Eagle.label();
            label_obj.x = wire_obj.x2;
            label_obj.y = wire_obj.y2;
            label_obj.size = labelSize;
            label_obj.layer = nameLayer;
            segment_obj.Items.Add(label_obj);
        }