private void FireNodeRemovingEvent(LocalNodeInfo node) { try { var info = new LocalNodeUpdateEventArgs() { nodeInfo = node, PCinfos = new List <SSDPPCInfo>() }; OnNodeUpdate?.Invoke(this, info); } catch (Exception exception) { logger.LogError(exception, $"Error getting info for node: {node.Url}"); } }
private async Task OnNewNodeDiscovered(LocalNodeInfo node, HttpResponseMessage req) { var res = JsonConvert.DeserializeObject <List <SSDPPCInfo> >(await req.Content.ReadAsStringAsync().ConfigureAwait(false)); if (res == null) { res = new List <SSDPPCInfo>(); } try { node.PcIds = res.Select(x => x.Id).ToList(); var info = new LocalNodeUpdateEventArgs() { nodeInfo = node, PCinfos = res }; OnNodeUpdate?.Invoke(this, info); } catch (Exception exception) { logger.LogError(exception, $"Error getting info for node: {node.Url}"); } SyncSharePCs(node, res); }