示例#1
0
        public static ElementBoardArray Create(XElement element)
        {
            if (element == null)
            {
                return(null);
            }

            ElementBoardArray item = new ElementBoardArray();

            foreach (XAttribute attribute in element.Attributes())
            {
                switch (attribute.Name.LocalName)
                {
                case "num": item.num = ReaderUtil.ConvertInt32(attribute.Value, 0); break;

                case "name": item.name = attribute.Value; break;

                case "x": item.x = ReaderUtil.ConvertSingle(attribute.Value, 0.0f); break;

                case "y": item.y = ReaderUtil.ConvertSingle(attribute.Value, 0.0f); break;

                case "orgx": item.orgx = ReaderUtil.ConvertSingle(attribute.Value, 0.0f); break;

                case "orgy": item.orgy = ReaderUtil.ConvertSingle(attribute.Value, 0.0f); break;

                case "rot": item.rot = ReaderUtil.ConvertSingle(attribute.Value, 0.0f); break;

                case "bExec": item.exec = ReaderUtil.ConvertBoolean(attribute.Value, false); break;

                case "group": item.group = ReaderUtil.ConvertInt32(attribute.Value, 0); break;
                }
            }
            item.rect = new System.Drawing.RectangleF(item.x + 40, (67.73f - 40 - item.y), 10.0f, 10.0f);
            return(item);
        }
示例#2
0
        public static ElementBoardArrays Create(XElement element)
        {
            if (element == null)
            {
                return(null);
            }

            ElementBoardArrays item = new ElementBoardArrays();

            item.Items
                = (from Element in element.Elements(ElementBoardArray.Name)
                   select ElementBoardArray.Create(Element)
                   ).ToArray();
            return(item);
        }