]> git.meshlink.io Git - catta/blobdiff - avahi-sharp/Client.cs
* Add RecordBrowser.cs
[catta] / avahi-sharp / Client.cs
index 394efc58e22100db7790d83782927e1815a923f2..01b08bd5934c9e8eae4c126548151ed579a80f82 100644 (file)
@@ -43,8 +43,23 @@ namespace Avahi
     internal delegate int PollCallback (IntPtr ufds, uint nfds, int timeout);
     internal delegate void ClientCallback (IntPtr client, ClientState state, IntPtr userData);
 
-    public delegate void ClientStateHandler (object o, ClientState state);
+    public delegate void ClientStateHandler (object o, ClientStateArgs state);
 
+    public class ClientStateArgs : EventArgs
+    {
+        private ClientState state;
+
+        public ClientState State
+        {
+            get { return state; }
+        }
+
+        public ClientStateArgs (ClientState state)
+        {
+            this.state = state;
+        }
+    }
+    
     public enum Protocol {
         Unspecified = -1,
         IPv4 = 0,
@@ -268,7 +283,7 @@ namespace Avahi
         private void OnClientCallback (IntPtr client, ClientState state, IntPtr userData)
         {
             if (StateChanged != null)
-                StateChanged (this, state);
+                StateChanged (this, new ClientStateArgs (state));
         }
 
         private int OnPollCallback (IntPtr ufds, uint nfds, int timeout) {