예제 #1
0
        /// <summary>
        /// Insert horizontal areas
        /// </summary>
        /// <param name="hZones">horizontal area list</param>
        /// <param name="content">content</param>
        public void InsertHorizontalZones(List <HorizontalZone> hZones, RefObject content)
        {
            bool added = false;

            for (int index = 0; index < hZones.Count; ++index)
            {
                if (index > this.indexX)
                {
                    HorizontalZone newH = new HorizontalZone();
                    newH.ConstraintHeight = EnumConstraint.FIXED;
                    newH.ConstraintWidth  = EnumConstraint.FIXED;
                    newH.Width            = (this.sizeX * (uint)Granne.TrueRectangle.Width + this.shiftRight - this.shiftLeft);
                    newH.Height           = (this.sizeY * (uint)Granne.TrueRectangle.Height + this.shiftBottom - this.shiftTop);
                    this.InsertVerticalZones(newH.VerticalZones, content);
                    hZones.Insert(index, newH);
                    added = true;
                    break;
                }
            }
            if (!added)
            {
                HorizontalZone newH = new HorizontalZone();
                newH.ConstraintHeight = EnumConstraint.FIXED;
                newH.ConstraintWidth  = EnumConstraint.FIXED;
                newH.Width            = (this.sizeX * (uint)Granne.TrueRectangle.Width + this.shiftRight - this.shiftLeft);
                newH.Height           = (this.sizeY * (uint)Granne.TrueRectangle.Height + this.shiftBottom - this.shiftTop);
                this.InsertVerticalZones(newH.VerticalZones, content);
                hZones.Add(newH);
            }
        }
예제 #2
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="r">ref object to copy</param>
 private RefObject(RefObject r)
 {
     this.Set(objectTypeName, ExtensionMethods.CloneThis(r.Type));
     this.Set(titleName, ExtensionMethods.CloneThis(r.Title));
     // this element is not cloned, use a reference
     this.Set(directObjectName, r.DirectObject);
 }
예제 #3
0
        /// <summary>
        /// Insert vertical areas
        /// </summary>
        /// <param name="vZones">vertical area list</param>
        /// <param name="content">content</param>
        public void InsertVerticalZones(List <VerticalZone> vZones, RefObject content)
        {
            bool added = false;

            for (int index = 0; index < vZones.Count; ++index)
            {
                if (index > this.indexX)
                {
                    VerticalZone newV = new VerticalZone();
                    newV.ConstraintHeight          = EnumConstraint.FIXED;
                    newV.ConstraintWidth           = EnumConstraint.FIXED;
                    newV.Width                     = (this.sizeX * (uint)Granne.TrueRectangle.Width + this.shiftRight - this.shiftLeft);
                    newV.Height                    = (this.sizeY * (uint)Granne.TrueRectangle.Height + this.shiftBottom - this.shiftTop);
                    content.DirectObject.Container = newV.Name;
                    vZones.Insert(index, newV);
                    added = true;
                    break;
                }
            }
            if (!added)
            {
                VerticalZone newV = new VerticalZone();
                newV.ConstraintHeight = EnumConstraint.FIXED;
                newV.ConstraintWidth  = EnumConstraint.FIXED;
                newV.Width            = (this.sizeX * (uint)Granne.TrueRectangle.Width + this.shiftRight - this.shiftLeft);
                newV.Height           = (this.sizeY * (uint)Granne.TrueRectangle.Height + this.shiftBottom - this.shiftTop);
                if (content != null)
                {
                    content.DirectObject.Container = newV.Name;
                }
                vZones.Add(newV);
            }
        }