private static void OnSubscribed(Client client) { EventHandler<SubscriptionEventArgs> handler = Subscribed; if (handler != null) { handler(null, new SubscriptionEventArgs( client)); } }
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 }); } })); }
public SubscriptionEventArgs(Client client) { this.client = client; }