Exemplo n.º 1
0
 public Rectangle(XmlNode node)
 {
     Left   = new VerticalSlice(node.GetValue("left"));
     Right  = new VerticalSlice(node.GetValue("right"));
     Top    = new HorizontalSlice(node.GetValue("top"));
     Bottom = new HorizontalSlice(node.GetValue("bottom"));
 }
Exemplo n.º 2
0
 public Rectangle(XmlNode node)
 {
     Left = new VerticalSlice(node.GetValue("left"));
       Right = new VerticalSlice(node.GetValue("right"));
       Top = new HorizontalSlice(node.GetValue("top"));
       Bottom = new HorizontalSlice(node.GetValue("bottom"));
 }
Exemplo n.º 3
0
 public Rectangle(VerticalSlice left, VerticalSlice right,
                  HorizontalSlice top, HorizontalSlice bottom)
 {
     Left   = left;
     Right  = right;
     Top    = top;
     Bottom = bottom;
 }
Exemplo n.º 4
0
 public Rectangle(VerticalSlice left, VerticalSlice right,
     HorizontalSlice top, HorizontalSlice bottom)
 {
     Left = left;
       Right = right;
       Top = top;
       Bottom = bottom;
 }
Exemplo n.º 5
0
        void CreateSliceFromXmlNode(XmlNode node)
        {
            var type = (XmlAttribute)node.Attributes.GetNamedItem("type");

            if (type.Value == "horizontal")
            {
                _horizontalSlices.Add(HorizontalSlice.Load(node));
            }
            else
            {
                _verticalSlices.Add(VerticalSlice.Load(node));
            }
        }
Exemplo n.º 6
0
        public void Init(Drawable drawable)
        {
            int width  = drawable.Width;
            int height = drawable.Height;

            var left = new VerticalSlice(null, null, 0)
            {
                Locked = true
            };

            _verticalSlices.Add(left);

            var right = new VerticalSlice(null, null, width)
            {
                Locked = true
            };

            _verticalSlices.Add(right);

            var top = new HorizontalSlice(left, right, 0)
            {
                Locked = true
            };

            _horizontalSlices.Add(top);

            var bottom = new HorizontalSlice(left, right, height)
            {
                Locked = true
            };

            _horizontalSlices.Add(bottom);

            left.Begin = right.Begin = top;
            left.End   = right.End = bottom;

            _rectangles.Add(new Rectangle(left, right, top, bottom));

            Changed = false;
        }
Exemplo n.º 7
0
        public void Init(Drawable drawable)
        {
            int width = drawable.Width;
              int height = drawable.Height;

              var left = new VerticalSlice(null, null, 0) {Locked = true};
              _verticalSlices.Add(left);

              var right = new VerticalSlice(null, null, width) {Locked = true};
              _verticalSlices.Add(right);

              var top = new HorizontalSlice(left, right, 0) {Locked = true};
              _horizontalSlices.Add(top);

              var bottom = new HorizontalSlice(left, right, height) {Locked = true};
              _horizontalSlices.Add(bottom);

              left.Begin = right.Begin = top;
              left.End = right.End = bottom;

              _rectangles.Add(new Rectangle(left, right, top, bottom));

              Changed = false;
        }
Exemplo n.º 8
0
 public bool HasVerticalSlice(VerticalSlice slice)
 {
     return((slice.X == X1 || slice.X == X2) &&
            slice.Y1 == Y1 && slice.Y2 == Y2);
 }
Exemplo n.º 9
0
 public bool HasVerticalSlice(VerticalSlice slice)
 {
     return (slice.X == X1 || slice.X == X2)
     && slice.Y1 == Y1 && slice.Y2 == Y2;
 }