private static void OnServiceFound(object o, ServiceArgs args) { if (args.Service.Name == server.Name) return; Console.WriteLine ("Found: " + args.Service.Name); if (args.Service.IsProtected) { Console.WriteLine ("Password is required, skipping"); return; } Client client = new Client (args.Service); client.Login (); client.Updated += OnClientUpdated; foreach (Database db in client.Databases) { server.AddDatabase (db); Console.WriteLine ("Added database: " + db.Name); } server.Commit (); clients.Add (client); }
private static void OnServiceRemoved(object o, ServiceArgs args) { Console.WriteLine ("Removed: " + args.Service.Name); foreach (Client client in clients) { if (client.Name == args.Service.Name) { clients.Remove (client); break; } } }
private static void OnServiceRemoved(object o, ServiceArgs args) { Console.WriteLine ("Removed: " + args.Service.Name); foreach (Client client in clients) { if (client.Name == args.Service.Name) { foreach (Database db in client.Databases) { server.RemoveDatabase (db); } clients.Remove (client); break; } } }
private static void OnServiceFound(object o, ServiceArgs args) { Console.WriteLine ("Found: " + args.Service.Name); Client client = new Client (args.Service); client.Login (); AddClient (client); }