summaryrefslogtreecommitdiffstats
path: root/avahi-sharp/Client.cs
diff options
context:
space:
mode:
authorJames Willcox <snopr@snorp.net>2005-09-09 23:48:54 +0000
committerJames Willcox <snopr@snorp.net>2005-09-09 23:48:54 +0000
commita9566d5dcac080d7fa91546823277c57a5d09a5f (patch)
tree1e82d5702a3e2b6c1cd19193ca3b93d4e2f065d2 /avahi-sharp/Client.cs
parente85d5d77e2bc6f03c4146e747904488e830ec2c9 (diff)
s/Host/HostName/ in a couple places, and keep references to callbacks to
avoid crashing git-svn-id: file:///home/lennart/svn/public/avahi/trunk@554 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-sharp/Client.cs')
-rw-r--r--avahi-sharp/Client.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/avahi-sharp/Client.cs b/avahi-sharp/Client.cs
index 3e4e617..84069fc 100644
--- a/avahi-sharp/Client.cs
+++ b/avahi-sharp/Client.cs
@@ -36,7 +36,9 @@ namespace Avahi
Removed
}
- internal delegate void ClientHandler (IntPtr client, ClientState state, IntPtr userData);
+ internal delegate void ClientCallback (IntPtr client, ClientState state, IntPtr userData);
+
+ public delegate void ClientStateHandler (object o, ClientState state);
public enum Protocol {
Unspecified = 0,
@@ -57,7 +59,7 @@ namespace Avahi
private IntPtr handle;
[DllImport ("avahi-client")]
- private static extern IntPtr avahi_client_new (IntPtr poll, ClientHandler handler,
+ private static extern IntPtr avahi_client_new (IntPtr poll, ClientCallback handler,
IntPtr userData, out int error);
[DllImport ("avahi-client")]
@@ -87,6 +89,8 @@ namespace Avahi
[DllImport ("avahi-glib")]
private static extern IntPtr avahi_glib_poll_get (IntPtr gpoll);
+ public event ClientStateHandler StateChanged;
+
internal IntPtr Handle
{
get { return handle; }
@@ -156,7 +160,8 @@ namespace Avahi
private void OnClientCallback (IntPtr client, ClientState state, IntPtr userData)
{
- Console.WriteLine ("Got new state: " + state);
+ if (StateChanged != null)
+ StateChanged (this, state);
}
}
}