Author: abock
Date: 2007-08-22 17:55:07 -0400 (Wed, 22 Aug 2007)
New Revision: 84667

Added:
   
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi.mdp
   
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/DBusManager.cs
   
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/IAvahiServer.cs
   
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/IAvahiServiceBrowser.cs
Modified:
   trunk/Mono.Zeroconf/
   trunk/Mono.Zeroconf/Mono.Zeroconf.mds
   trunk/Mono.Zeroconf/configure.ac
   trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf.Providers/IZeroconfProvider.xml
   
trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf.Providers/ZeroconfProviderAttribute.xml
   trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IRegisterService.xml
   trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IResolvableService.xml
   trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IService.xml
   trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IServiceBrowser.xml
   trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ITxtRecord.xml
   trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/RegisterService.xml
   trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceBrowseEventArgs.xml
   trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceBrowseEventHandler.xml
   trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceBrowser.xml
   trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceResolvedEventArgs.xml
   trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceResolvedEventHandler.xml
   trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/TxtRecord.xml
   trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/TxtRecordItem.xml
   trunk/Mono.Zeroconf/docs/en/index.xml
   trunk/Mono.Zeroconf/src/MZClient/MZClient.mdp
   trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Makefile.am
   
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/ServiceBrowser.cs
   
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/ZeroconfProvider.cs
   
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Bonjour/Mono.Zeroconf.Providers.Bonjour.mdp
   
trunk/Mono.Zeroconf/src/Mono.Zeroconf/Mono.Zeroconf.Providers/ProviderFactory.cs
   trunk/Mono.Zeroconf/src/Mono.Zeroconf/Mono.Zeroconf.mdp
Log:
Initial work for Avahi/DBus provider


Property changes on: trunk/Mono.Zeroconf
___________________________________________________________________
Name: svn:ignore
   - configure
Makefile.in
config.*
autom4te.cache
INSTALL
missing
Makefile
aclocal.m4
install-sh
*.userprefs

   + configure
Makefile.in
config.*
autom4te.cache
INSTALL
missing
Makefile
aclocal.m4
install-sh
*.userprefs
*.usertasks


Modified: trunk/Mono.Zeroconf/Mono.Zeroconf.mds
===================================================================
--- trunk/Mono.Zeroconf/Mono.Zeroconf.mds       2007-08-22 21:48:16 UTC (rev 
84666)
+++ trunk/Mono.Zeroconf/Mono.Zeroconf.mds       2007-08-22 21:55:07 UTC (rev 
84667)
@@ -5,17 +5,20 @@
       <Entry build="True" name="Mono.Zeroconf" configuration="Debug" />
       <Entry build="True" name="Mono.Zeroconf.Providers.Bonjour" 
configuration="Debug" />
       <Entry build="True" name="MZClient" configuration="Debug" />
+      <Entry build="True" name="Mono.Zeroconf.Providers.Avahi" 
configuration="Debug" />
     </Configuration>
   </Configurations>
-  <DeployTargets />
   <StartMode startupentry="MZClient" single="True">
     <Execute type="None" entry="Mono.Zeroconf" />
     <Execute type="None" entry="Mono.Zeroconf.Providers.Bonjour" />
     <Execute type="None" entry="MZClient" />
+    <Execute type="None" entry="Mono.Zeroconf.Providers.Avahi" />
   </StartMode>
+  <DeployTargets />
   <Entries>
     <Entry filename="./src/Mono.Zeroconf/Mono.Zeroconf.mdp" />
     <Entry 
filename="./src/Mono.Zeroconf.Providers.Bonjour/Mono.Zeroconf.Providers.Bonjour.mdp"
 />
     <Entry filename="./src/MZClient/MZClient.mdp" />
+    <Entry 
filename="./src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi.mdp"
 />
   </Entries>
 </Combine>
\ No newline at end of file

Modified: trunk/Mono.Zeroconf/configure.ac
===================================================================
--- trunk/Mono.Zeroconf/configure.ac    2007-08-22 21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/configure.ac    2007-08-22 21:55:07 UTC (rev 84667)
@@ -25,7 +25,7 @@
        [Do not build with Avahi support]), , enable_avahi=yes)
 
 if test "x$enable_avahi" = "xyes"; then
-       PKG_CHECK_MODULES(AVAHI, avahi-sharp >= 0.6)
+       PKG_CHECK_MODULES(AVAHI, ndesk-dbus-1.0 >= 0.5.0)
        AC_SUBST(AVAHI_LIBS)
        AM_CONDITIONAL(BUILD_AVAHI, true)
 else
@@ -54,5 +54,7 @@
 
     Avahi Support:           ${enable_avahi}
     Developer Documentation: ${enable_docs}
+
+       ${localstatedir}
 "
 

Modified: trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IRegisterService.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IRegisterService.xml      
2007-08-22 21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IRegisterService.xml      
2007-08-22 21:55:07 UTC (rev 84667)
@@ -2,7 +2,7 @@
   <TypeSignature Language="C#" Value="public interface IRegisterService : 
Mono.Zeroconf.IService" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Interfaces>
     <Interface>

Modified: trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IResolvableService.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IResolvableService.xml    
2007-08-22 21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IResolvableService.xml    
2007-08-22 21:55:07 UTC (rev 84667)
@@ -2,7 +2,7 @@
   <TypeSignature Language="C#" Value="public interface IResolvableService : 
Mono.Zeroconf.IService" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Interfaces>
     <Interface>

Modified: trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IService.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IService.xml      2007-08-22 
21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IService.xml      2007-08-22 
21:55:07 UTC (rev 84667)
@@ -2,7 +2,7 @@
   <TypeSignature Language="C#" Value="public interface IService" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Interfaces />
   <Docs>

Modified: trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IServiceBrowser.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IServiceBrowser.xml       
2007-08-22 21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/IServiceBrowser.xml       
2007-08-22 21:55:07 UTC (rev 84667)
@@ -1,8 +1,8 @@
 <Type Name="IServiceBrowser" FullName="Mono.Zeroconf.IServiceBrowser">
-  <TypeSignature Language="C#" Value="public interface IServiceBrowser : 
System.IDisposable" />
+  <TypeSignature Language="C#" Value="public interface IServiceBrowser : 
IDisposable" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Interfaces>
     <Interface>

Modified: trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ITxtRecord.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ITxtRecord.xml    2007-08-22 
21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ITxtRecord.xml    2007-08-22 
21:55:07 UTC (rev 84667)
@@ -1,8 +1,8 @@
 <Type Name="ITxtRecord" FullName="Mono.Zeroconf.ITxtRecord">
-  <TypeSignature Language="C#" Value="public interface ITxtRecord : 
System.Collections.IEnumerable, System.IDisposable" />
+  <TypeSignature Language="C#" Value="public interface ITxtRecord : 
IDisposable, System.Collections.IEnumerable" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Interfaces>
     <Interface>

Modified: trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/RegisterService.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/RegisterService.xml       
2007-08-22 21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/RegisterService.xml       
2007-08-22 21:55:07 UTC (rev 84667)
@@ -2,7 +2,7 @@
   <TypeSignature Language="C#" Value="public class RegisterService : 
Mono.Zeroconf.IRegisterService" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Base>
     <BaseTypeName>System.Object</BaseTypeName>

Modified: trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceBrowseEventArgs.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceBrowseEventArgs.xml        
2007-08-22 21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceBrowseEventArgs.xml        
2007-08-22 21:55:07 UTC (rev 84667)
@@ -1,8 +1,8 @@
 <Type Name="ServiceBrowseEventArgs" 
FullName="Mono.Zeroconf.ServiceBrowseEventArgs">
-  <TypeSignature Language="C#" Value="public class ServiceBrowseEventArgs : 
System.EventArgs" />
+  <TypeSignature Language="C#" Value="public class ServiceBrowseEventArgs : 
EventArgs" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Base>
     <BaseTypeName>System.EventArgs</BaseTypeName>

Modified: 
trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceBrowseEventHandler.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceBrowseEventHandler.xml     
2007-08-22 21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceBrowseEventHandler.xml     
2007-08-22 21:55:07 UTC (rev 84667)
@@ -2,7 +2,7 @@
   <TypeSignature Language="C#" Value="public delegate void 
ServiceBrowseEventHandler(object o, ServiceBrowseEventArgs args);" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Base>
     <BaseTypeName>System.Delegate</BaseTypeName>

Modified: trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceBrowser.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceBrowser.xml        
2007-08-22 21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceBrowser.xml        
2007-08-22 21:55:07 UTC (rev 84667)
@@ -2,7 +2,7 @@
   <TypeSignature Language="C#" Value="public class ServiceBrowser : 
Mono.Zeroconf.IServiceBrowser" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Base>
     <BaseTypeName>System.Object</BaseTypeName>

Modified: trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceResolvedEventArgs.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceResolvedEventArgs.xml      
2007-08-22 21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceResolvedEventArgs.xml      
2007-08-22 21:55:07 UTC (rev 84667)
@@ -1,8 +1,8 @@
 <Type Name="ServiceResolvedEventArgs" 
FullName="Mono.Zeroconf.ServiceResolvedEventArgs">
-  <TypeSignature Language="C#" Value="public class ServiceResolvedEventArgs : 
System.EventArgs" />
+  <TypeSignature Language="C#" Value="public class ServiceResolvedEventArgs : 
EventArgs" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Base>
     <BaseTypeName>System.EventArgs</BaseTypeName>

Modified: 
trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceResolvedEventHandler.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceResolvedEventHandler.xml   
2007-08-22 21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/ServiceResolvedEventHandler.xml   
2007-08-22 21:55:07 UTC (rev 84667)
@@ -2,7 +2,7 @@
   <TypeSignature Language="C#" Value="public delegate void 
ServiceResolvedEventHandler(object o, ServiceResolvedEventArgs args);" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Base>
     <BaseTypeName>System.Delegate</BaseTypeName>

Modified: trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/TxtRecord.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/TxtRecord.xml     2007-08-22 
21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/TxtRecord.xml     2007-08-22 
21:55:07 UTC (rev 84667)
@@ -2,7 +2,7 @@
   <TypeSignature Language="C#" Value="public class TxtRecord : 
Mono.Zeroconf.ITxtRecord" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Base>
     <BaseTypeName>System.Object</BaseTypeName>

Modified: trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/TxtRecordItem.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/TxtRecordItem.xml 2007-08-22 
21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf/TxtRecordItem.xml 2007-08-22 
21:55:07 UTC (rev 84667)
@@ -2,7 +2,7 @@
   <TypeSignature Language="C#" Value="public class TxtRecordItem" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Base>
     <BaseTypeName>System.Object</BaseTypeName>

Modified: 
trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf.Providers/IZeroconfProvider.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf.Providers/IZeroconfProvider.xml   
2007-08-22 21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf.Providers/IZeroconfProvider.xml   
2007-08-22 21:55:07 UTC (rev 84667)
@@ -2,36 +2,9 @@
   <TypeSignature Language="C#" Value="public interface IZeroconfProvider" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Interfaces />
-  <Members>
-    <Member MemberName="Initialize">
-      <MemberSignature Language="C#" Value="public void Initialize ();" />
-      <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue>
-      <Parameters />
-      <Docs><summary>Method to perform any kind of subsystem initialization 
and sanity check.</summary><remarks>This method is responsible for ensuring the 
underlying Zeroconf subsystem is running. If the subsystem cannot be contacted, 
this method should throw an exception. In the Bonjour implementation, this 
method opens and closes a test connection to the mDNSResponder daemon to ensure 
it is running.</remarks></Docs>
-    </Member>
-    <Member MemberName="RegisterService">
-      <MemberSignature Language="C#" Value="public System.Type RegisterService 
{ get; };" />
-      <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>System.Type</ReturnType></ReturnValue>
-      <Docs><summary>Type of provider's <see 
cref="T:Mono.Zeroconf.IRegisterService" /></summary><value>A type which 
implements <see cref="T:Mono.Zeroconf.IRegisterService" /></value><remarks>To 
be added.</remarks></Docs>
-    </Member>
-    <Member MemberName="ServiceBrowser">
-      <MemberSignature Language="C#" Value="public System.Type ServiceBrowser 
{ get; };" />
-      <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>System.Type</ReturnType></ReturnValue>
-      <Docs><summary>Type of provider's <see 
cref="T:Mono.Zeroconf.IServiceBrowser" /></summary><value>A type which 
implements <see cref="T:Mono.Zeroconf.IServiceBrowser" /></value><remarks>To be 
added.</remarks></Docs>
-    </Member>
-    <Member MemberName="TxtRecord">
-      <MemberSignature Language="C#" Value="public System.Type TxtRecord { 
get; };" />
-      <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>System.Type</ReturnType></ReturnValue>
-      <Docs><summary>Type of provider's <see cref="T:Mono.Zeroconf.ITxtRecord" 
/></summary><value>A type which implements <see 
cref="T:Mono.Zeroconf.ITxtRecord" /></value><remarks>To be 
added.</remarks></Docs>
-    </Member>
-  </Members>
   <Docs>
     <summary>The "entry point" interface for Zeroconf provider 
assemblies.</summary>
     <remarks>
@@ -65,4 +38,31 @@
       </example>
        </remarks>
   </Docs>
+  <Members>
+    
+    
+    
+    <Member MemberName="Initialize">
+      <MemberSignature Language="C#" Value="public void Initialize ();" />
+      <MemberType>Method</MemberType>
+      <ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue>
+      <Parameters />
+      <Docs><summary>Method to perform any kind of subsystem initialization 
and sanity check.</summary><remarks>This method is responsible for ensuring the 
underlying Zeroconf subsystem is running. If the subsystem cannot be contacted, 
this method should throw an exception. In the Bonjour implementation, this 
method opens and closes a test connection to the mDNSResponder daemon to ensure 
it is running.</remarks></Docs>
+    </Member><Member MemberName="RegisterService">
+      <MemberSignature Language="C#" Value="public Type RegisterService { get; 
};" />
+      <MemberType>Property</MemberType>
+      <ReturnValue><ReturnType>System.Type</ReturnType></ReturnValue>
+      <Docs><summary>Type of provider's <see 
cref="T:Mono.Zeroconf.IRegisterService" /></summary><value>A type which 
implements <see cref="T:Mono.Zeroconf.IRegisterService" /></value><remarks>To 
be added.</remarks></Docs>
+    </Member><Member MemberName="ServiceBrowser">
+      <MemberSignature Language="C#" Value="public Type ServiceBrowser { get; 
};" />
+      <MemberType>Property</MemberType>
+      <ReturnValue><ReturnType>System.Type</ReturnType></ReturnValue>
+      <Docs><summary>Type of provider's <see 
cref="T:Mono.Zeroconf.IServiceBrowser" /></summary><value>A type which 
implements <see cref="T:Mono.Zeroconf.IServiceBrowser" /></value><remarks>To be 
added.</remarks></Docs>
+    </Member><Member MemberName="TxtRecord">
+      <MemberSignature Language="C#" Value="public Type TxtRecord { get; };" />
+      <MemberType>Property</MemberType>
+      <ReturnValue><ReturnType>System.Type</ReturnType></ReturnValue>
+      <Docs><summary>Type of provider's <see cref="T:Mono.Zeroconf.ITxtRecord" 
/></summary><value>A type which implements <see 
cref="T:Mono.Zeroconf.ITxtRecord" /></value><remarks>To be 
added.</remarks></Docs>
+    </Member>
+  </Members>
 </Type>

Modified: 
trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf.Providers/ZeroconfProviderAttribute.xml
===================================================================
--- 
trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf.Providers/ZeroconfProviderAttribute.xml
   2007-08-22 21:48:16 UTC (rev 84666)
+++ 
trunk/Mono.Zeroconf/docs/en/Mono.Zeroconf.Providers/ZeroconfProviderAttribute.xml
   2007-08-22 21:55:07 UTC (rev 84667)
@@ -1,27 +1,13 @@
 <Type Name="ZeroconfProviderAttribute" 
FullName="Mono.Zeroconf.Providers.ZeroconfProviderAttribute">
-  <TypeSignature Language="C#" Value="public class ZeroconfProviderAttribute : 
System.Attribute" />
+  <TypeSignature Language="C#" Value="public class ZeroconfProviderAttribute : 
Attribute" />
   <AssemblyInfo>
     <AssemblyName>Mono.Zeroconf</AssemblyName>
-    <AssemblyVersion>0.8.1.30538</AssemblyVersion>
+    <AssemblyVersion>0.8.1.20450</AssemblyVersion>
   </AssemblyInfo>
   <Base>
     <BaseTypeName>System.Attribute</BaseTypeName>
   </Base>
   <Interfaces />
-  <Members>
-    <Member MemberName=".ctor">
-      <MemberSignature Language="C#" Value="public ZeroconfProviderAttribute 
(System.Type providerType);" />
-      <MemberType>Constructor</MemberType>
-      <Parameters><Parameter Name="providerType" Type="System.Type" 
/></Parameters>
-      <Docs><param name="providerType">Type of the provider bound to the 
assembly</param><summary>This type must implement <see 
cref="T:Mono.Zeroconf.Proviers.IZeroconfService" />.</summary><remarks>To be 
added.</remarks></Docs>
-    </Member>
-    <Member MemberName="ProviderType">
-      <MemberSignature Language="C#" Value="public System.Type ProviderType { 
get; };" />
-      <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>System.Type</ReturnType></ReturnValue>
-      <Docs><summary>Type of the provider bound to the 
assembly</summary><value>Value passed to the constructor.</value><remarks>This 
property is only used by the internal Mono.Zeroconf factory that loads Zeroconf 
providers.</remarks></Docs>
-    </Member>
-  </Members>
   <Docs>
     <summary>Assembly level attribute required for Zeroconf provider 
assemblies</summary>
     <remarks>
@@ -38,6 +24,20 @@
       </example>
     </remarks>
   </Docs>
+  <Members>
+    
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public ZeroconfProviderAttribute 
(Type providerType);" />
+      <MemberType>Constructor</MemberType>
+      <Parameters><Parameter Name="providerType" Type="System.Type" 
/></Parameters>
+      <Docs><param name="providerType">Type of the provider bound to the 
assembly</param><summary>This type must implement <see 
cref="T:Mono.Zeroconf.Proviers.IZeroconfService" />.</summary><remarks>To be 
added.</remarks></Docs>
+    </Member><Member MemberName="ProviderType">
+      <MemberSignature Language="C#" Value="public Type ProviderType { get; 
};" />
+      <MemberType>Property</MemberType>
+      <ReturnValue><ReturnType>System.Type</ReturnType></ReturnValue>
+      <Docs><summary>Type of the provider bound to the 
assembly</summary><value>Value passed to the constructor.</value><remarks>This 
property is only used by the internal Mono.Zeroconf factory that loads Zeroconf 
providers.</remarks></Docs>
+    </Member>
+  </Members>
   <Attributes>
     <Attribute>
       
<AttributeName>System.AttributeUsage(System.AttributeTargets.Assembly)</AttributeName>

Modified: trunk/Mono.Zeroconf/docs/en/index.xml
===================================================================
--- trunk/Mono.Zeroconf/docs/en/index.xml       2007-08-22 21:48:16 UTC (rev 
84666)
+++ trunk/Mono.Zeroconf/docs/en/index.xml       2007-08-22 21:55:07 UTC (rev 
84667)
@@ -1,6 +1,6 @@
 <Overview>
   <Assemblies>
-    <Assembly Name="Mono.Zeroconf" Version="0.8.1.30538">
+    <Assembly Name="Mono.Zeroconf" Version="0.8.1.20450">
       <Attributes>
         <Attribute>
           
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
@@ -25,22 +25,22 @@
   <Types>
     <Namespace Name="Mono.Zeroconf">
       <Type Name="IRegisterService" />
+      <Type Name="IResolvableService" />
       <Type Name="IService" />
-      <Type Name="IResolvableService" />
       <Type Name="IServiceBrowser" />
       <Type Name="ITxtRecord" />
       <Type Name="RegisterService" />
       <Type Name="ServiceBrowseEventArgs" />
+      <Type Name="ServiceBrowseEventHandler" />
       <Type Name="ServiceBrowser" />
       <Type Name="ServiceResolvedEventArgs" />
+      <Type Name="ServiceResolvedEventHandler" />
       <Type Name="TxtRecord" />
       <Type Name="TxtRecordItem" />
-      <Type Name="ServiceBrowseEventHandler" />
-      <Type Name="ServiceResolvedEventHandler" />
     </Namespace>
     <Namespace Name="Mono.Zeroconf.Providers">
+      <Type Name="IZeroconfProvider" />
       <Type Name="ZeroconfProviderAttribute" />
-      <Type Name="IZeroconfProvider" />
     </Namespace>
   </Types>
   <Title>Mono.Zeroconf</Title>

Modified: trunk/Mono.Zeroconf/src/MZClient/MZClient.mdp
===================================================================
--- trunk/Mono.Zeroconf/src/MZClient/MZClient.mdp       2007-08-22 21:48:16 UTC 
(rev 84666)
+++ trunk/Mono.Zeroconf/src/MZClient/MZClient.mdp       2007-08-22 21:55:07 UTC 
(rev 84667)
@@ -1,18 +1,19 @@
-<Project name="MZClient" fileversion="2.0" language="C#" clr-version="Net_1_1" 
ctype="DotNetProject">
+<Project name="MZClient" fileversion="2.0" language="C#" clr-version="Net_2_0" 
ctype="DotNetProject">
   <Configurations active="Debug">
     <Configuration name="Debug" ctype="DotNetProjectConfiguration">
       <Output directory="./" assembly="MZClient" />
       <Build debugmode="True" target="Exe" />
-      <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" 
clr-version="Net_1_1" />
+      <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" 
clr-version="Net_2_0" />
       <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" 
unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" 
generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
     </Configuration>
   </Configurations>
-  <DeployTargets />
   <Contents>
     <File name="./ZeroconfClient.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Project" localcopy="True" refto="Mono.Zeroconf" />
-    <ProjectReference type="Gac" localcopy="True" refto="System, 
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+    <ProjectReference type="Gac" localcopy="True" refto="System, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+    <ProjectReference type="Project" localcopy="True" 
refto="Mono.Zeroconf.Providers.Avahi" />
   </References>
+  <DeployTargets />
 </Project>
\ No newline at end of file

Modified: 
trunk/Mono.Zeroconf/src/Mono.Zeroconf/Mono.Zeroconf.Providers/ProviderFactory.cs
===================================================================
--- 
trunk/Mono.Zeroconf/src/Mono.Zeroconf/Mono.Zeroconf.Providers/ProviderFactory.cs
    2007-08-22 21:48:16 UTC (rev 84666)
+++ 
trunk/Mono.Zeroconf/src/Mono.Zeroconf/Mono.Zeroconf.Providers/ProviderFactory.cs
    2007-08-22 21:55:07 UTC (rev 84667)
@@ -82,11 +82,11 @@
                             if(attr is ZeroconfProviderAttribute) {
                                 Type type = (attr as 
ZeroconfProviderAttribute).ProviderType;
                                 IZeroconfProvider provider = 
(IZeroconfProvider)Activator.CreateInstance(type);
-                                try {
+                               // try {
                                     provider.Initialize();
                                     providers_list.Add(provider);
-                                       } catch {
-                                }
+                               //      } catch {
+                               // }
                             }
                         }
                     }

Modified: trunk/Mono.Zeroconf/src/Mono.Zeroconf/Mono.Zeroconf.mdp
===================================================================
--- trunk/Mono.Zeroconf/src/Mono.Zeroconf/Mono.Zeroconf.mdp     2007-08-22 
21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/src/Mono.Zeroconf/Mono.Zeroconf.mdp     2007-08-22 
21:55:07 UTC (rev 84667)
@@ -1,13 +1,12 @@
-<Project name="Mono.Zeroconf" fileversion="2.0" language="C#" 
clr-version="Net_1_1" ctype="DotNetProject">
+<Project name="Mono.Zeroconf" fileversion="2.0" language="C#" 
clr-version="Net_2_0" ctype="DotNetProject">
   <Configurations active="Debug">
     <Configuration name="Debug" ctype="DotNetProjectConfiguration">
       <Output directory="./" assembly="Mono.Zeroconf" />
       <Build debugmode="True" target="Library" />
-      <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" 
clr-version="Net_1_1" />
+      <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" 
clr-version="Net_2_0" />
       <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" 
unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" 
generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
     </Configuration>
   </Configurations>
-  <DeployTargets />
   <Contents>
     <File name="./Mono.Zeroconf/RegisterService.cs" subtype="Code" 
buildaction="Compile" />
     <File name="./Mono.Zeroconf/ServiceBrowser.cs" subtype="Code" 
buildaction="Compile" />
@@ -27,7 +26,8 @@
     <File name="./Mono.Zeroconf.Providers/ProviderFactory.cs" subtype="Code" 
buildaction="Compile" />
   </Contents>
   <References>
-    <ProjectReference type="Gac" localcopy="True" refto="System, 
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-    <ProjectReference type="Gac" localcopy="True" refto="System.Web, 
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+    <ProjectReference type="Gac" localcopy="True" refto="System, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+    <ProjectReference type="Gac" localcopy="True" refto="System.Web, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   </References>
+  <DeployTargets />
 </Project>
\ No newline at end of file

Modified: trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Makefile.am
===================================================================
--- trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Makefile.am   
2007-08-22 21:48:16 UTC (rev 84666)
+++ trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Makefile.am   
2007-08-22 21:55:07 UTC (rev 84667)
@@ -2,14 +2,20 @@
 ASSEMBLY = $(ASSEMBLY_NAME).dll
 
 MONO_ZEROCONF_PROVIDERS_AVAHI_SRC = \
-       Mono.Zeroconf.Providers.Avahi/ResolvableService.cs \
-       Mono.Zeroconf.Providers.Avahi/ServiceBrowser.cs \
-       Mono.Zeroconf.Providers.Avahi/Service.cs \
-       Mono.Zeroconf.Providers.Avahi/TxtRecord.cs \
-       Mono.Zeroconf.Providers.Avahi/ZeroconfProvider.cs
+       IAvahiServiceBrowser.cs \
+       DBusManager.cs \
+       IAvahiServer.cs \
+       ZeroconfProvider.cs \
+       ServiceBrowser.cs
 
+#Mono.Zeroconf.Providers.Avahi/ResolvableService.cs \
+#Mono.Zeroconf.Providers.Avahi/ServiceBrowser.cs \
+#Mono.Zeroconf.Providers.Avahi/Service.cs \
+#Mono.Zeroconf.Providers.Avahi/TxtRecord.cs \
+#Mono.Zeroconf.Providers.Avahi/ZeroconfProvider.cs
+
 SOURCES_PRE = \
-       $(MONO_ZEROCONF_PROVIDERS_AVAHI_SRC)
+       $(foreach 
source,$(MONO_ZEROCONF_PROVIDERS_AVAHI_SRC),Mono.Zeroconf.Providers.Avahi/$(source))
 
 SOURCES = \
        $(top_srcdir)/src/AssemblyInfo.cs \

Added: 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/DBusManager.cs
===================================================================
--- 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/DBusManager.cs
  2007-08-22 21:48:16 UTC (rev 84666)
+++ 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/DBusManager.cs
  2007-08-22 21:55:07 UTC (rev 84667)
@@ -0,0 +1,134 @@
+//
+// DBusManager.cs
+//
+// Authors:
+//     Aaron Bockover  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using System.Reflection;
+using System.Threading;
+
+using NDesk.DBus;
+
+namespace Mono.Zeroconf.Providers.Avahi
+{
+    internal static class DBusManager
+    {
+       private const uint MINIMUM_AVAHI_API_VERSION = 515;
+        
+        private static object iterate_thread_mutex = new object();
+        private static int iterate_freeze_count = 0;
+        private static Thread iterate_thread;
+
+               private static Bus bus;
+
+        private static IAvahiServer server;
+        public static IAvahiServer Server {
+               get { return server; }
+        }
+        
+        private static void InitializeSystemBusConnection()
+        {
+            string address = 
Environment.GetEnvironmentVariable("DBUS_SYSTEM_BUS_ADDRESS");
+            if(String.IsNullOrEmpty(address)) {
+               address = "unix:path=/var/run/dbus/system_bus_socket";
+            }
+                       
+                       bus = Bus.Open(address);
+        }
+
+        public static void Initialize()
+        {
+            InitializeSystemBusConnection();
+            
+                       if(!bus.NameHasOwner("org.freedesktop.Avahi")) {
+                               throw new ApplicationException("Could not find 
org.freedesktop.Avahi");
+                       }
+                       
+                       server = 
bus.GetObject<IAvahiServer>("org.freedesktop.Avahi", new ObjectPath("/"));
+                       uint api_version = server.GetAPIVersion();
+                       
+                       if(api_version < MINIMUM_AVAHI_API_VERSION) {
+                               throw new 
ApplicationException(String.Format("Avahi API version " +
+                                       "{0} is required, but {1} is what the 
server returned.", 
+                                       MINIMUM_AVAHI_API_VERSION, 
api_version));
+                       }
+                       
+                       // If you remove this you will see that the events 
+                       // come through -- it'll work for the first object,
+                       // but once the thread is created you are hosed.
+                       // Leaving this call here for testing/debugging
+                       // while the iterate issue is looked into. For
+                       // production, this call will be deferred until
+                       // it's necessary.
+                       EnsureIterate();
+        }
+        
+        public static T GetObject<T>(string object_path)
+        {
+               return GetObject<T>(new ObjectPath(object_path));
+        }
+
+               public static T GetObject<T>(ObjectPath object_path)
+               {
+                       return bus.GetObject<T>("org.freedesktop.Avahi", 
object_path);
+               }
+        
+        public static void EnsureIterate()
+        {
+               lock(iterate_thread_mutex) {
+                       if(iterate_thread != null) {
+                               return;
+                       }
+                       
+                       iterate_thread = new Thread(Iterate);
+                       iterate_thread.IsBackground = true;
+                       iterate_thread.Start();
+               }
+        }
+        
+        private static void Iterate()
+        {
+                       while(true) {
+                               if(iterate_freeze_count == 0) {
+                                       bus.Iterate();
+                               }
+                       }
+        }
+        
+        public static void BusLock()
+        {
+               Interlocked.Increment(ref iterate_freeze_count);
+               EnsureIterate();
+        }
+        
+        public static void BusUnlock()
+        {
+               Interlocked.Decrement(ref iterate_freeze_count);
+               EnsureIterate();
+        }
+    }
+}

Added: 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/IAvahiServer.cs
===================================================================
--- 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/IAvahiServer.cs
 2007-08-22 21:48:16 UTC (rev 84666)
+++ 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/IAvahiServer.cs
 2007-08-22 21:55:07 UTC (rev 84667)
@@ -0,0 +1,42 @@
+//
+// IServer.cs
+//
+// Authors:
+//     Aaron Bockover  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NDesk.DBus;
+
+namespace Mono.Zeroconf.Providers.Avahi
+{ 
+    [Interface("org.freedesktop.Avahi.Server")]
+    public interface IAvahiServer
+    {
+        uint GetAPIVersion();
+        
+        ObjectPath ServiceBrowserNew(int @interface, int protocol, 
+            string type, string domain, uint flags);
+    }   
+}

Added: 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/IAvahiServiceBrowser.cs
===================================================================
--- 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/IAvahiServiceBrowser.cs
 2007-08-22 21:48:16 UTC (rev 84666)
+++ 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/IAvahiServiceBrowser.cs
 2007-08-22 21:55:07 UTC (rev 84667)
@@ -0,0 +1,50 @@
+//
+// IServiceBrowser.cs
+//
+// Authors:
+//     Aaron Bockover  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NDesk.DBus;
+
+namespace Mono.Zeroconf.Providers.Avahi
+{
+    public delegate void ServiceBrowserItemHandler(int @interface, int 
protocol, string name, 
+        string type, string domain, uint flags);
+
+    public delegate void ServiceBrowserHandler();
+
+    [Interface("org.freedesktop.Avahi.ServiceBrowser")]
+    public interface IAvahiServiceBrowser
+    {
+        event ServiceBrowserItemHandler ItemNew;
+        event ServiceBrowserItemHandler ItemRemove;
+        
+        event ServiceBrowserHandler AllForNow;
+        event ServiceBrowserHandler CacheExhausted;
+        
+        void Free();
+    }   
+}

Modified: 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/ServiceBrowser.cs
===================================================================
--- 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/ServiceBrowser.cs
       2007-08-22 21:48:16 UTC (rev 84666)
+++ 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/ServiceBrowser.cs
       2007-08-22 21:55:07 UTC (rev 84667)
@@ -27,58 +27,54 @@
 //
 
 using System;
-using AV=Avahi;
 using Mono.Zeroconf;
 
 namespace Mono.Zeroconf.Providers.Avahi
 {
     public class ServiceBrowser : IServiceBrowser
     {
-        private AV.Client client;
-        private AV.ServiceBrowser browser;
-    
         public event ServiceBrowseEventHandler ServiceAdded;
         public event ServiceBrowseEventHandler ServiceRemoved;
     
+       private IAvahiServiceBrowser service_browser;
+    
         public ServiceBrowser()
         {
         }
         
         public void Dispose()
         {
-            if(client != null) {
-                client.Dispose();
-                client = null;
-            }
-            
-            if(browser != null) {
-                browser.Dispose();
-                browser = null;
-            }
+               if(service_browser != null) {
+                       service_browser.ItemNew -= OnItemNew;
+                       service_browser.ItemRemove -= OnItemRemove;
+                       service_browser.Free();
+               }
         }
     
         public void Browse(string regtype, string domain)
         {
             Dispose();
             
-            client = new AV.Client();
+            DBusManager.BusLock();
             
-            browser = new AV.ServiceBrowser(client, regtype, domain);
-            browser.ServiceAdded += OnServiceAdded;
-            browser.ServiceRemoved += OnServiceRemoved;
+            service_browser = DBusManager.GetObject<IAvahiServiceBrowser>(
+               DBusManager.Server.ServiceBrowserNew(-1, -1, regtype, domain, 
0));
+            service_browser.ItemNew += OnItemNew;
+            service_browser.ItemRemove += OnItemRemove;
+            
+            DBusManager.BusUnlock();
         }
         
-        private void OnServiceAdded(object o, AV.ServiceInfoArgs args)
+        private void OnItemNew(int @interface, int protocol, string name, 
+               string type, string domain, uint flags)
         {
-            ServiceBrowseEventHandler handler = ServiceAdded;
-            if(handler != null) {
-                handler(this, new ServiceBrowseEventArgs(new 
ResolvableService(client, args.Service)));
-            }
+               Console.WriteLine("NEW ITEM: {0}", name);
         }
         
-        private void OnServiceRemoved(object o, AV.ServiceInfoArgs args)
+        private void OnItemRemove(int @interface, int protocol, string name, 
+               string type, string domain, uint flags)
         {
-            
+               Console.WriteLine("ITEM REMOVED: {0}", name);
         }
     }
 }

Modified: 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/ZeroconfProvider.cs
===================================================================
--- 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/ZeroconfProvider.cs
     2007-08-22 21:48:16 UTC (rev 84666)
+++ 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi/ZeroconfProvider.cs
     2007-08-22 21:55:07 UTC (rev 84667)
@@ -37,6 +37,7 @@
     {
         public void Initialize()
         {
+            DBusManager.Initialize();
         }
         
         public Type ServiceBrowser { 
@@ -44,7 +45,7 @@
         }
         
         public Type RegisterService { 
-            get { return typeof(Mono.Zeroconf.Providers.Avahi.TxtRecord); }
+            get { return null; }
         }
         
         public Type TxtRecord {

Added: 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi.mdp
===================================================================
--- 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi.mdp
     2007-08-22 21:48:16 UTC (rev 84666)
+++ 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Avahi/Mono.Zeroconf.Providers.Avahi.mdp
     2007-08-22 21:55:07 UTC (rev 84667)
@@ -0,0 +1,26 @@
+<Project name="Mono.Zeroconf.Providers.Avahi" fileversion="2.0" language="C#" 
clr-version="Net_2_0" ctype="DotNetProject">
+  <Configurations active="Debug">
+    <Configuration name="Debug" ctype="DotNetProjectConfiguration">
+      <Output directory="./" assemblyKeyFile="./" 
assembly="Mono.Zeroconf.Providers.Avahi" />
+      <Build debugmode="True" target="Library" />
+      <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" 
clr-version="Net_2_0" />
+      <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" 
unsafecodeallowed="False" generateoverflowchecks="True" 
generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+    </Configuration>
+  </Configurations>
+  <Contents>
+    <File name="./Mono.Zeroconf.Providers.Avahi/ResolvableService.cs" 
subtype="Code" buildaction="Nothing" />
+    <File name="./Mono.Zeroconf.Providers.Avahi/Service.cs" subtype="Code" 
buildaction="Nothing" />
+    <File name="./Mono.Zeroconf.Providers.Avahi/ServiceBrowser.cs" 
subtype="Code" buildaction="Compile" />
+    <File name="./Mono.Zeroconf.Providers.Avahi/TxtRecord.cs" subtype="Code" 
buildaction="Nothing" />
+    <File name="./Mono.Zeroconf.Providers.Avahi/ZeroconfProvider.cs" 
subtype="Code" buildaction="Compile" />
+    <File name="./Mono.Zeroconf.Providers.Avahi/DBusManager.cs" subtype="Code" 
buildaction="Compile" />
+    <File name="./Mono.Zeroconf.Providers.Avahi/IAvahiServer.cs" 
subtype="Code" buildaction="Compile" />
+    <File name="./Mono.Zeroconf.Providers.Avahi/IAvahiServiceBrowser.cs" 
subtype="Code" buildaction="Compile" />
+  </Contents>
+  <References>
+    <ProjectReference type="Project" localcopy="True" refto="Mono.Zeroconf" />
+    <ProjectReference type="Gac" localcopy="True" refto="System, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+    <ProjectReference type="Gac" localcopy="True" refto="System.Web, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+    <ProjectReference type="Gac" localcopy="True" refto="NDesk.DBus, 
Version=1.0.0.0, Culture=neutral, PublicKeyToken=f6716e4f9b2ed099" />
+  </References>
+</Project>
\ No newline at end of file

Modified: 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Bonjour/Mono.Zeroconf.Providers.Bonjour.mdp
===================================================================
--- 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Bonjour/Mono.Zeroconf.Providers.Bonjour.mdp
 2007-08-22 21:48:16 UTC (rev 84666)
+++ 
trunk/Mono.Zeroconf/src/Mono.Zeroconf.Providers.Bonjour/Mono.Zeroconf.Providers.Bonjour.mdp
 2007-08-22 21:55:07 UTC (rev 84667)
@@ -1,13 +1,12 @@
-<Project name="Mono.Zeroconf.Providers.Bonjour" fileversion="2.0" 
language="C#" clr-version="Net_1_1" ctype="DotNetProject">
+<Project name="Mono.Zeroconf.Providers.Bonjour" fileversion="2.0" 
language="C#" clr-version="Net_2_0" ctype="DotNetProject">
   <Configurations active="Debug">
     <Configuration name="Debug" ctype="DotNetProjectConfiguration">
       <Output directory="./" assembly="Mono.Zeroconf.Providers.Bonjour" />
       <Build debugmode="True" target="Library" />
-      <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" 
clr-version="Net_1_1" />
+      <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" 
clr-version="Net_2_0" />
       <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" 
unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" 
generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
     </Configuration>
   </Configurations>
-  <DeployTargets />
   <Contents>
     <File name="./Mono.Zeroconf.Providers.Bonjour/BrowseService.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./Mono.Zeroconf.Providers.Bonjour/Native.cs" subtype="Code" 
buildaction="Compile" />
@@ -26,7 +25,8 @@
   </Contents>
   <References>
     <ProjectReference type="Project" localcopy="True" refto="Mono.Zeroconf" />
-    <ProjectReference type="Gac" localcopy="True" refto="System, 
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-    <ProjectReference type="Gac" localcopy="True" refto="System.Web, 
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+    <ProjectReference type="Gac" localcopy="True" refto="System, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+    <ProjectReference type="Gac" localcopy="True" refto="System.Web, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   </References>
+  <DeployTargets />
 </Project>
\ No newline at end of file

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to