public static IRowCol ToRowCol(this XElement Elem, XNamespace Namespace) { IRowCol item = null; if (Elem != null) { int rowNum = Elem.Element(Namespace + "RowNum").IntOrDefault(0).Value; int colNum = Elem.Element(Namespace + "ColNum").IntOrDefault(0).Value; int height = Elem.Element(Namespace + "Height").IntOrDefault(24).Value; int width = Elem.Element(Namespace + "Width").IntOrDefault(80).Value; var frame = Elem.Element(Namespace + "Frame").StringOrDefault("").TryParseLocationFrame(LocationFrame.ZeroBased).Value; item = RowColBase.Factory(frame, rowNum, colNum, height, width); } return(item); }
public static XElement ToXElement(this RowColBase 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("Height", RowCol.Dim.Height), new XElement("Width", RowCol.Dim.Width), new XElement("Frame", RowCol.LocationFrame) ); return(xe); } }
public static XElement ToXElement(this RowColBase RowCol) { var xe = RowCol.ToXElement("RowCol"); return(xe); }