diff options
author | James Willcox <snopr@snorp.net> | 2005-09-09 17:12:57 +0000 |
---|---|---|
committer | James Willcox <snopr@snorp.net> | 2005-09-09 17:12:57 +0000 |
commit | ba12decc4413dedf22c06545d1ec5938efa8954a (patch) | |
tree | 6bd8edc20ffabbbd9300264677a983695787dd7f /avahi-sharp/ClientException.cs | |
parent | e1d06346134b3051878c8080694068517faf3f16 (diff) |
add initial mono bindings
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@538 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-sharp/ClientException.cs')
-rw-r--r-- | avahi-sharp/ClientException.cs | 30 |
1 files changed, 30 insertions, 0 deletions
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); + } + } +} |