public static IScreenLoc ToScreenLoc(this XElement Elem, XNamespace Namespace) { IScreenLoc item = null; if (Elem != null) { int rowNum = Elem.Element(Namespace + "RowNum").IntOrDefault(0).Value; int colNum = Elem.Element(Namespace + "ColNum").IntOrDefault(0).Value; var frame = Elem.Element(Namespace + "Frame").StringOrDefault("").TryParseLocationFrame(LocationFrame.ZeroBased).Value; item = ScreenLocBase.Factory(frame, rowNum, colNum); } return(item); }
public static XElement ToXElement(this ScreenLocBase RowCol, XName Name) { if (RowCol == null) { return(new XElement(Name, null)); } else { XElement xe = new XElement(Name, new XElement("RowNum", RowCol.RowNum), new XElement("ColNum", RowCol.ColNum), new XElement("Frame", RowCol.LocationFrame) ); return(xe); } }
public static XElement ToXElement(this ScreenLocBase RowCol) { var xe = RowCol.ToXElement("RowCol"); return(xe); }