Beispiel #1
0
 private void DelItem(AsyncUserToken token, JsonItem jsonItem)
 {
     lock (_ProcessList)
     {
         ProcessItem item = null;
         Boolean     tf   = false;
         foreach (var i in _ProcessList)
         {
             if (i.ProcessId == jsonItem.PID)
             {
                 item = i; tf = true;
             }
             break;
         }
         if (tf == true)
         {
             _ProcessList.Remove(item);
             _SocketManager.SendMessage(token, new byte[] { 68, 101, 108, 73, 116, 101, 109, 79, 75 }); // DelItemOK
         }
         else
         {
             _SocketManager.SendMessage(token, new byte[] { 78, 111, 116, 70, 111, 117, 110, 100, 68, 101, 108, 73, 116, 101, 109, 79 }); // NotFoundDelItem
         }
     }
 }
Beispiel #2
0
        private void AddItem(AsyncUserToken token, JsonItem jsonItem)
        {
            var item = new ProcessItem(jsonItem.PID, jsonItem.UserName, jsonItem.Remake, jsonItem.Timer, jsonItem.Pause);

            lock (_ProcessList) _ProcessList.Add(item);
            _SocketManager.SendMessage(token, new byte[] { 65, 100, 100, 73, 116, 101, 109, 79, 75 }); // AddItemOK
        }
Beispiel #3
0
 private void QueItem(AsyncUserToken token)
 {
     lock (_ProcessList)
     {
         foreach (var i in _ProcessList)
         {
             var json = new JsonItem()
             {
                 PID      = i.ProcessId,
                 UserName = i.CreateUsername,
                 Remake   = i.Remake,
                 Timer    = i.TimerInterval,
                 Pause    = i.PauseInterval
             };
             var    msg  = JsonConvert.SerializeObject(json);
             byte[] msgb = Encoding.UTF8.GetBytes(msg);
             _SocketManager.SendMessage(token, msgb);
         }
     } _SocketManager.SendMessage(token, new byte[] { 81, 117, 101, 114, 121, 79, 75 }); // QueryOK
 }