상속: System.EventArgs
예제 #1
0
파일: Mirror.cs 프로젝트: gburt/dmap-sharp
        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);
        }
예제 #2
0
        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;
                }
            }
        }
예제 #3
0
파일: Mirror.cs 프로젝트: gburt/dmap-sharp
        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;
                }
            }
        }
예제 #4
0
        private static void OnServiceFound(object o, ServiceArgs args)
        {
            Console.WriteLine ("Found: " + args.Service.Name);

            Client client = new Client (args.Service);
            client.Login ();

            AddClient (client);
        }