Exemplo n.º 1
0
        async void DrawNodes()
        {
            List <Node> alive = await HealthCheck.CheckHealth(Init.Peers);

            List <Node>   dead    = Init.Peers.Except(alive).ToList();
            MarkerOptions moAlive = new MarkerOptions()
            {
                Icon = @"http://i.imgur.com/JPV3KXR.png", Clickable = true, DraggingEnabled = false, Flat = false, Optimized = true, RaiseOnDrag = true
            };
            MarkerOptions moDead = new MarkerOptions()
            {
                Icon = @"http://i.imgur.com/WpTAa9N.png", Clickable = true, DraggingEnabled = false, Flat = false, Optimized = true, RaiseOnDrag = true
            };

            foreach (Node pn in Init.Peers)
            {
                var Marker = Map.AddMarker(new GeographicLocation(pn.NodeLocation.lat, pn.NodeLocation.lon), (alive.Contains(pn) ? moAlive : moDead));
                Marker.Click += (im, gl) =>
                {
                    KeySelection ks = new KeySelection(pn.GetLogs());
                    ks.ShowDialog();
                    Main m = new Main(pn, ks.Selection);
                    m.Show();
                };
            }
        }
Exemplo n.º 2
0
        void PostPutFile(Node.Method m, string filename)
        {
            Document doc;

            using (FileStream fs = new FileStream(filename, FileMode.Open))
            {
                doc = Document.FromStream(fs);
            }
            if (m == Node.Method.Put)
            {
                KeySelection ks = new KeySelection(GetKeys());
                ks.ShowDialog();
                if (ks.Selection == "")
                {
                    return;
                }
                doc.id = ks.Selection;
            }
            OpenNode.PostDocument(doc, curLog, Guid.NewGuid().ToString());
        }