예제 #1
0
 private static void OnSubscribed(Client client)
 {
     EventHandler<SubscriptionEventArgs> handler = Subscribed;
     if (handler != null)
     {
         handler(null,
           new SubscriptionEventArgs( client));
     }
 }
예제 #2
0
        void server_OnRegistringEvent(Client clientInfo)
        {
            string regMsg = String.Format("User:{0}\nPC@{1}\nPhone@{2}",clientInfo.UserName,clientInfo.ClientIPEndPoint,clientInfo.PhoneUri);
            Dispatcher.BeginInvoke((Action)(() =>
            {
                bool find = false;
                foreach (ListBoxItem item in listBoxRecieved.Items)
                {
                    if (item.Name == clientInfo.UserName)
                    {
                        item.Content = regMsg;
                    }
                    find = true;
                    break;
                }

                if (find == false)
                {
                    listBoxRecieved.Items.Add(new ListBoxItem { Name = clientInfo.UserName, Content = regMsg });
                }
            }));
        }
예제 #3
0
 public SubscriptionEventArgs(Client client)
 {
     this.client = client; 
 }