Exemple #1
0
        void DisposeControl(object o, DataLive dataLive)
        {
            int i = -1;

            if (dataLive.ControlType == "Device")
            {
                i = DeviceC.FindIndex(x => x.ID == dataLive.ControlName);
                DeviceC[i].userRelease();
                cloud.IPmanager("Remove", "DeviceList", cloud.FindIp("DeviceList", DeviceC[i].ID));
                if (i != -1)
                {
                    DeviceC.RemoveAt(i);
                }
                Console.WriteLine("RemoveDevice");
                m.SimulateNewIPLEvent(cloud.DeviceList);
            }
            if (dataLive.ControlType == "User")
            {
                i = UserC.FindIndex(x => x.ID == dataLive.ControlName);
                UserC[i].release();
                cloud.IPmanager("Remove", "UserList", cloud.FindIp("UserList", UserC[i].ID));
                UserC[i].Unregister();
                if (i != -1)
                {
                    UserC.RemoveAt(i);
                }
                Console.WriteLine("RemoveUser");
            }
        }
Exemple #2
0
        public void SimulateNewDataLiveEvent(string type, string name, bool live)
        {
            DataLive e = new DataLive(type, name, live);

            OnDataLiveEvent(e);
        }
Exemple #3
0
 public void OnDataLiveEvent(DataLive e)
 {
     DataLiveEvent?.Invoke(this, e);
 }