Example #1
0
        public static DrawSize FromString(string size)
        {
            DrawSize newSize = new DrawSize();

            string [] sizeParts = size.Split(new char[]{ ',' }, 2);
            newSize.Width = float.Parse(sizeParts[0]);
            newSize.Height = float.Parse(sizeParts[1]);

            return newSize;
        }
Example #2
0
        public virtual void Parse(string data)
        {
            XmlNode node = XmlUtils.CreateNodeFromData(data);

            string positionValue = XmlUtils.GetAttributeValue(node, POSITION);
            string sizeValue = XmlUtils.GetAttributeValue(node, SIZE);
            string idValue = XmlUtils.GetAttributeValue(node, ID);

            this.Position = DrawPoint.FromString(positionValue);
            this.Size = DrawSize.FromString(sizeValue);
            this.Id = idValue;
        }