Ejemplo n.º 1
0
 private void sessionSubscriber(string data, ref int sz)
 {
     MessageBox.Show("SUBSCRIBED" + data);
     if (_session == null)
     {
         _session = new AllJoynSession(_allJoyn);
     }
     _session.NewParticipant(data);
 }
Ejemplo n.º 2
0
 private bool parseForIdentity(string data)
 {
     if (data.Contains(token))
     {
         //
         //    MessageBox.Show("PARSING " + data);
         int i = data.IndexOf(token);
         if (i > 2)
         {
             string tmp = data.Replace(token, "<");
             string key = data.Substring(0, i - 2);
             //    MessageBox.Show("KEY = |" + key + "|");
             tmp = tmp.Replace(key, " ");
             tmp = tmp.Substring(1, tmp.Length - 1);
             int start = tmp.IndexOf("<");
             int stop  = tmp.IndexOf(">");
             tmp = tmp.Remove(stop);
             start++;
             tmp = tmp.Substring(start, tmp.Length - start);
             //  MessageBox.Show( "TMP = " + tmp);
             if (!_session.HasKey(key))
             {
                 _session.NewParticipant(key);
                 _chatText.AppendLine("*** ADD " + key + " **** ");
                 //          sendIdentityMessage();
             }
             else
             {
                 _chatText.AppendLine("*** Found " + key + " **** ");
             }
             return(true);
         }
     }
     //      _chatText.AppendLine("*** NOT FOUND **** ");
     return(false);
 }