예제 #1
0
 private void Form_Main_Resize(object sender, EventArgs e)
 {
     if ((this.ClientSize.Height - 30) <= detailForm?.Height)
     {
         detailForm?.Close();
         detailForm = null;
     }
     else
     {
         if (detailForm != null)
         {
             detailForm.Location = new Point(this.Location.X, this.ClientSize.Height - 30 - detailForm.Height);
         }
     }
 }
예제 #2
0
 private void 设备状态列表ToolStripMenuItem_Click(object sender, System.EventArgs e)
 {
     if (detailForm == null || detailForm.IsDisposed)
     {
         detailForm = new DeviceDetailList();
     }
     detailForm.Location = new Point(this.Location.X, this.ClientSize.Height - 30 - detailForm.Height);
     detailForm.TopMost  = true;
     if ((this.ClientSize.Height - 30) > detailForm.Height)
     {
         if (deviceVM.DeviceList.Count == 0)
         {
             deviceVM.InitData();
         }
         detailForm.Show();
         detailForm.SetBinding(deviceVM);
     }
 }
예제 #3
0
        public Form_Main()
        {
            InitializeComponent();
            // this.IsMdiContainer = true;
            detailForm = new DeviceDetailList();
            CenterToScreen();
            CheckForIllegalCrossThreadCalls = false;
            ButtonExt btn = new ButtonExt();

            btn.BtnContent     = "设置组";
            btn.IsSelect       = true;
            btn.Index          = 1;
            btn.OnButtonClick += Btn_OnButtonClick;
            flowLayoutPanel_Tab.Controls.Add(btn);
            roomNoList.Add(btn);
            Form_Room room = new Form_Room();

            room.StartScan();
            roomDic.Add("设置组", room);
            room.RoomList             = roomDic.Keys.ToList();
            room.OnDeviceRoomChanged += Room_OnDeviceRoomChanged;
            room.RoomName             = "设置组";
            LoadRoom("设置组");
            CheckForIllegalCrossThreadCalls = false;
            InitObj();
            //测试
            //allAuthorityData = service1Client.getAllAuthorityData("分组2");
            f_main = this;
            //
            LoadTrainForm();
            // LoadRoom("设置组");
            InitGroupForm();

            //for (int i = 0; i < 5; i++)
            //    AddRoom();
            //test
            //TestSockets();
            InitThread();
        }