Ejemplo n.º 1
0
 public void AddFormShow(Form_Show fm)
 {
     flowLayoutPanel1.Controls.Add(fm);
     devices_list.Add(fm);
     fm.Computer_RBS();
     fm.OnRoomChanged += Fm_OnRoomChanged;
     fm.Show();
 }
Ejemplo n.º 2
0
 public void Test()
 {
     for (int i = 0; i < 10; i++)
     {
         Form_Show fm = new Form_Show();
         fm.FormName = "计算机" + i.ToString();
         fm.TopLevel = false;
         fm.Parent   = flowLayoutPanel1;
         fm.AddDevice("计算机" + i.ToString(), "0");
         fm.Show();
         flowLayoutPanel1.Controls.Add(fm);
     }
 }
Ejemplo n.º 3
0
        public void AddFormShow(string ip, string mac)
        {
            Form_Show fm = new Form_Show();

            fm.FormName = ip;
            fm.TopLevel = false;
            fm.Parent   = flowLayoutPanel1;
            fm.AddDevice(ip, mac);
            fm.RoomList = roomList;
            fm.RoomName = roomName;
            flowLayoutPanel1.Controls.Add(fm);
            devices_list.Add(fm);
            fm.Computer_RBS();
            fm.Show();
        }
Ejemplo n.º 4
0
        public void AddFormShow(LANAllComputerIp.ComputerIpInfo cr)
        {
            Form_Show fm = new Form_Show();

            fm.FormName = cr.ip;
            fm.TopLevel = false;
            fm.Parent   = flowLayoutPanel1;
            fm.AddDevice(cr.ip, cr.mac);
            fm.RoomList       = roomList;
            fm.RoomName       = roomName;
            fm.OnRoomChanged += Fm_OnRoomChanged;
            flowLayoutPanel1.Controls.Add(fm);
            devices_list.Add(fm);
            fm.Show();
        }
Ejemplo n.º 5
0
        private void Fm_OnRoomChanged(string room, string formName)
        {
            Form_Show fm = null;

            foreach (Form_Show device in devices_list)
            {
                if (device.FormName == formName)
                {
                    flowLayoutPanel1.Controls.Remove(device);
                    fm          = device;
                    changedForm = device;
                    break;
                }
            }
            fm.RoomName       = room;
            fm.OnRoomChanged -= Fm_OnRoomChanged;
            devices_list.Remove(fm);
            this.OnDeviceRoomChanged?.Invoke(room, fm);
        }
Ejemplo n.º 6
0
        private void Room_OnDeviceRoomChanged(string toRoom, Form_Show device)
        {
            Form_Room room = roomDic[toRoom];

            room.AddFormShow(device);
        }