コード例 #1
0
        private void _rpc_OnUpdateEvent(RPCController sender, string id, EventType type, long peerId, long channelIndex, string variable)
        {
            if (type == EventType.Timed)
            {
                if (!TimedEvents.ContainsKey(id))
                {
                    return;
                }

                Event currentEvent = TimedEvents[id];
                _rpc.GetEvent(currentEvent);
                EventUpdated?.Invoke(this, currentEvent);
            }
            else
            {
                if (!Devices.ContainsKey(peerId))
                {
                    return;
                }

                Device device = Devices[peerId];
                if (!device.Events.ContainsKey(id))
                {
                    return;
                }

                Event currentEvent = device.Events[id];
                _rpc.GetEvent(currentEvent);
                EventUpdated?.Invoke(this, currentEvent);
            }
        }
コード例 #2
0
 private void _rpc_OnUpdateEvent(RPCController sender, String id, EventType type, Int32 peerID, Int32 channelIndex, String variable)
 {
     if (type == EventType.Timed)
     {
         if (!TimedEvents.ContainsKey(id))
         {
             return;
         }
         Event currentEvent = TimedEvents[id];
         _rpc.GetEvent(currentEvent);
         if (EventUpdated != null)
         {
             EventUpdated(this, currentEvent);
         }
     }
     else
     {
         if (!Devices.ContainsKey(peerID))
         {
             return;
         }
         Device device = Devices[peerID];
         if (!device.Events.ContainsKey(id))
         {
             return;
         }
         Event currentEvent = device.Events[id];
         _rpc.GetEvent(currentEvent);
         if (EventUpdated != null)
         {
             EventUpdated(this, currentEvent);
         }
     }
 }