Example #1
0
        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);
        }
Example #2
0
 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);
     }
 }
Example #3
0
        public static XElement ToXElement(this RowColBase RowCol)
        {
            var xe = RowCol.ToXElement("RowCol");

            return(xe);
        }