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

            return(xe);
        }