Exemplo n.º 1
0
        public static GraphPeer FromJson(JObject json)
        {
            GraphPeer peer = new GraphPeer();

            peer.Address = json["address"].AsString();
            peer.Port    = int.Parse(json["port"].AsString());
            return(peer);
        }
Exemplo n.º 2
0
        public static GraphPeers FromJson(JObject json)
        {
            GraphPeers result = new GraphPeers();

            result.Unconnected = ((JArray)json["unconnected"]).Select(p => GraphPeer.FromJson(p)).ToArray();
            result.Bad         = ((JArray)json["bad"]).Select(p => GraphPeer.FromJson(p)).ToArray();
            result.Connected   = ((JArray)json["connected"]).Select(p => GraphPeer.FromJson(p)).ToArray();
            return(result);
        }