Пример #1
0
 private void messageServer_MessageRecieved(object sender, MessageRecievedEventArgs e)
 {
     if (e.Message is SubscriberMessage)
     {
         SubscriberMessage message = (SubscriberMessage)e.Message;
         lock(_lockObject)
         {
             if(_subscribers.ContainsKey(e.ClientId))
             {
                 Subscriber subscriber = _subscribers[e.ClientId];
                 switch(message.Command)
                 {
                 case "Password":
                     if(message.Data.ToString() == "staticPassword")
                         _messageServer.SendMessageToClient(e.ClientId, );
                     break;
                 case "SmsPassword":
                     break;
                 default:
                     break;
                 }
             }
         }
     }
 }
Пример #2
0
 /// <summary>
 /// </summary>
 /// <param name="sender">
 /// </param>
 /// <param name="e">
 /// </param>
 private void messageServer_MessageRecieved(object sender, MessageRecievedEventArgs e)
 {
     if (e.Message is SubscribeMessage)
     {
         var message = (SubscribeMessage)e.Message;
         if (this.subscribers.ContainsKey(e.ClientId))
         {
             this.subscribers[e.ClientId].City = message.City;
         }
     }
 }