// Действие - использование public void Use(Clients clients, Computer curcomp, int intervalUse) { if (curcomp == null) { return; } if (clients == null) { return; } Operation ops = new Operation { to = TypeOperation.StartUse, cl = clients, comp = curcomp, Message = "Начало использования" }; clients.Active = false; Event_actions?.Invoke(ops); Thread.Sleep(intervalUse); ops = new Operation { to = TypeOperation.StopUse, cl = clients, comp = curcomp, Message = "Конец пользования" }; Event_actions?.Invoke(ops); clients.Active = true; }
//Действие - Включение public void On(Clients clients, Computer curcomp) { if (clients == null) { return; } Operation ops = new Operation { to = TypeOperation.On, cl = clients, comp = curcomp, Message = "Включили компьютер" }; Event_actions?.Invoke(ops); }