Esempio n. 1
0
        public bool TryParse(XmlConfigNode node, out Rectangle value)
        {
            value = Rectangle.Empty;
            XmlConfigNode locNode  = node.Lookup("location", false);
            XmlConfigNode sizeNode = node.Lookup("size", false);

            if (locNode == null || sizeNode == null)
            {
                return(false);
            }
            Size  size;
            Point location;

            if (!SizeParser.Instance.TryParse(sizeNode, out size))
            {
                return(false);
            }
            if (!PointParser.Instance.TryParse(locNode, out location))
            {
                return(false);
            }
            value = new Rectangle(location, size);
            return(true);
        }