private void handleRequestAppListMessage(RequestAppListMessage msg, IPAddress sender) { Debug.WriteLine("Sending AppList to " + sender.ToString()); AppListMessage sendMsg = new AppListMessage(); sendMsg.availableApps = Library.Apps.Values.ToList(); _tcpAgent.SendMessage(sendMsg, sender); }
private void handleAppListMessage(AppListMessage msg, IPAddress sender) { SyncPeer found = _peers.Find((peer) => { return(peer.Address.Equals(sender)); }); if (found == null) { Debug.WriteLine("Received AppList from unknown peer " + sender.ToString()); } found.Apps = msg.availableApps; updateAvailableApps(); Debug.WriteLine(String.Format("{0} has {1} available apps", found.Hostname, found.Apps.Count)); SyncPeerUpdatedEventHandler handler = OnSyncPeerUpdated; if (handler != null) { handler(this, new SyncPeerUpdatedEventArgs(found, SyncPeerUpdatedAction.Updated)); } }