Beispiel #1
0
        private void Messenger_PinSetCommand(ReceivedCommand args)
        {
            int  pin   = args.ReadInt16Arg();
            bool state = args.ReadBoolArg();

            NamedPin p = NamedPin.GetNamedPin(pin);

            OnPinSet(p, state);
        }
Beispiel #2
0
 private void Server_MessageReceived(Object sender, MessageReceivedEventArgs e)
 {
     String[] s = e.Message.Split(',');
     if (s.Length == 2)
     {
         try
         {
             NamedPin p = NamedPin.GetNamedPin(s[0].Trim());
             bool     state;
             if (Boolean.TryParse(s[1], out state))
             {
                 _board.SetPin(p, state);
             }
         }
         catch (ArgumentException) { }
     }
 }
 public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
 {
     return(NamedPin.GetNamedPin(JToken.Load(reader).Value <String>()));
 }