Exemplo n.º 1
0
        public void ConfigFloor(int floorCount)
        {
            this.floorCount = floorCount;

            CarbinetFloor cf = new CarbinetFloor(this, 1, this.controlArray);

            //int top = cf.floor_height * this.floors.Count;
            cf.Top          = 0;
            cf.Height       = 130;
            cf.Left         = this.left;
            cf.maxDocNumber = 9;
            this.floors.Add(cf);
            cf              = new CarbinetFloor(this, 2, this.controlArray);
            cf.Top          = 130;
            cf.Height       = 110;
            cf.Left         = this.left;
            cf.maxDocNumber = 9;
            this.floors.Add(cf);
            //for (int i = 1; i <= floorCount; i++)
            //{
            //    CarbinetFloor cf = new CarbinetFloor(i, this.controlArray);
            //    int top = cf.floor_height * this.floors.Count;
            //    cf.top = top;
            //    this.floors.Add(cf);
            //}
        }
Exemplo n.º 2
0
        /// <summary>
        /// 配置档案柜的层,每层的高度和放置档案的最大数量
        /// </summary>
        /// <param name="floorIndex"></param>
        /// <param name="height"></param>
        /// <param name="maxDoc"></param>
        public void ConfigFloor(int floorIndex, int height, int maxDoc)
        {
            CarbinetFloor floor = null;

            if (floorIndex <= 0)
            {
                Debug.WriteLine("floor index error,start from 1");
                return;
            }
            if (floorIndex == 1)
            {
                if (this.floors.Count >= 1)
                {
                    floor = this.floors[0];
                }
                else
                {
                    floor = new CarbinetFloor(this, 1, this.controlArray);
                    this.floors.Add(floor);
                }
            }
            else
            {
                if (floorIndex - 1 > this.floors.Count)// 越层初始化,即初始化2层的时候1层尚未初始化
                {
                    Debug.WriteLine(string.Format("initial floor error ->  floor index = {0}", floorIndex));
                    return;
                }
                if (floorIndex <= this.floors.Count)
                {
                    floor = this.floors[floorIndex - 1];
                }
                else
                {
                    floor = new CarbinetFloor(this, floorIndex, this.controlArray);
                    this.floors.Add(floor);
                }
            }
            if (floor != null)
            {
                floor.Height       = height;
                floor.maxDocNumber = maxDoc;
            }
            // 每层的空间配置
            if (floor.floorNumber == 1)
            {
                floor.Top  = 24;
                floor.Left = this.leftPading;
            }

            if (floor.floorNumber == 2)
            {
                floor.Top  = 137;
                floor.Left = this.leftPading;
            }
            if (floor.floorNumber == 3)
            {
                floor.Top  = 220;
                floor.Left = this.leftPading;
            }
        }
Exemplo n.º 3
0
 public void AddFloor(CarbinetFloor cf)
 {
     cf.Left = this.left + cf.relativeLeft;
     cf.Top  = this.top + cf.relativeTop;
     this.floors.Add(cf);
 }