From ba12decc4413dedf22c06545d1ec5938efa8954a Mon Sep 17 00:00:00 2001 From: James Willcox Date: Fri, 9 Sep 2005 17:12:57 +0000 Subject: add initial mono bindings git-svn-id: file:///home/lennart/svn/public/avahi/trunk@538 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-sharp/ClientException.cs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 avahi-sharp/ClientException.cs (limited to 'avahi-sharp/ClientException.cs') diff --git a/avahi-sharp/ClientException.cs b/avahi-sharp/ClientException.cs new file mode 100644 index 0000000..f38f438 --- /dev/null +++ b/avahi-sharp/ClientException.cs @@ -0,0 +1,30 @@ + +using System; +using System.Runtime.InteropServices; + +namespace Avahi +{ + public class ClientException : ApplicationException + { + private int code; + + [DllImport ("avahi-common")] + private static extern IntPtr avahi_strerror (int code); + + public int ErrorCode + { + get { return code; } + } + + internal ClientException (int code) : base (GetErrorString (code)) + { + this.code = code; + } + + private static string GetErrorString (int code) + { + IntPtr str = avahi_strerror (code); + return Utility.PtrToString (str); + } + } +} -- cgit