Inheritance: BrowserBase, IDisposable
コード例 #1
0
                public void Dispose ()
                {
			if (browser == null)
				return;

                        browser.Dispose ();
                        browser = null;
                }
コード例 #2
0
ファイル: AvahiTest.cs プロジェクト: anastiel/avahi
    private static void OnServiceTypeAdded (object o, ServiceTypeInfoArgs args)
    {
        Console.WriteLine ("Got service type: " + args.ServiceType.ServiceType);
        ServiceBrowser sb = new ServiceBrowser (client, args.ServiceType.ServiceType, args.ServiceType.Domain);
        objects.Add (sb);

        sb.ServiceAdded += OnServiceAdded;
    }
コード例 #3
0
ファイル: ServiceBrowser.cs プロジェクト: hacxman/zeroshare
        public void Browse(string regtype, string domain)
        {
            Dispose();

            client = new AV.Client();

            browser = new AV.ServiceBrowser(client, regtype, domain);
            browser.ServiceAdded += OnServiceAdded;
            browser.ServiceRemoved += OnServiceRemoved;
        }
コード例 #4
0
        public void Browse(string regtype, string domain)
        {
            Dispose();

            client = new AV.Client();

            browser = new AV.ServiceBrowser(client, regtype, domain);
            browser.ServiceAdded   += OnServiceAdded;
            browser.ServiceRemoved += OnServiceRemoved;
        }
コード例 #5
0
        public void Dispose()
        {
            if (client != null)
            {
                client.Dispose();
                client = null;
            }

            if (browser != null)
            {
                browser.Dispose();
                browser = null;
            }
        }
コード例 #6
0
ファイル: ServiceBrowser.cs プロジェクト: hacxman/zeroshare
        public void Dispose()
        {
            if(client != null) {
                client.Dispose();
                client = null;
            }

            if(browser != null) {
                browser.Dispose();
                browser = null;
            }
        }
コード例 #7
0
                public void Start ()
                {
                        browser = new ServiceBrowser (avahi_client, "_beagle._tcp");
                        browser.ServiceAdded += OnServiceAdded;
                        browser.ServiceRemoved += OnServiceRemoved;
		}
コード例 #8
0
		public ICollection<NetworkService> GetServicesBlocking ()
		{
			object sync_lock = new object ();

			lock (sync_lock) {
				browser = new ServiceBrowser (avahi_client, "_beagle._tcp");
				browser.ServiceAdded += OnServiceAdded;
				browser.AllForNow += delegate (object o, EventArgs args) {
					Console.WriteLine ("All for now!");
					lock (sync_lock) {
						Monitor.Pulse (sync_lock);
					}
				};
				
				Monitor.Wait (sync_lock);

				Console.WriteLine ("Return!");
			}
			
			return services;
                }
コード例 #9
0
ファイル: ServiceFinder.cs プロジェクト: MrJoe/lat
 public void Start()
 {
     try {
         sb = new ServiceBrowser (client, "_ldap._tcp");
         sb.ServiceAdded += OnServiceAdded;
         sb.ServiceRemoved += OnServiceRemoved;
     } catch (Exception e) {
         Log.Debug (e);
     }
 }