Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Namespace Members | Data Fields | Related Pages

Error.cs

00001 namespace DBus 
00002 {
00003   
00004   using System;
00005   using System.Runtime.InteropServices;
00006   using System.Diagnostics;
00007   
00008   // FIXME add code to verify that size of DBus.Error
00009   // matches the C code.
00010   
00011   [StructLayout (LayoutKind.Sequential)]
00012   internal struct Error
00013   {
00014     internal IntPtr name;
00015     internal IntPtr message;
00016     private int dummies;
00017     private IntPtr padding1;
00018     
00019     public void Init() 
00020     {
00021       dbus_error_init(ref this);
00022     }
00023     
00024     public void Free() 
00025     {
00026       dbus_error_free(ref this);
00027     }
00028     
00029     public string Message
00030     {
00031       get
00032         {
00033           return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(message);
00034         }
00035     }
00036     
00037     public string Name
00038     {
00039       get
00040         {
00041           return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(name);
00042         }
00043     }
00044 
00045     public bool IsSet
00046     {
00047       get
00048         {
00049           return (name != IntPtr.Zero);
00050         }
00051     }
00052     
00053     
00054     [DllImport ("dbus-1", EntryPoint="dbus_error_init")]
00055     private extern static void dbus_error_init (ref Error error);
00056     
00057     [DllImport ("dbus-1", EntryPoint="dbus_error_free")]
00058     private extern static void dbus_error_free (ref Error error);
00059   }
00060 }

Generated on Tue Sep 13 01:28:08 2005 for D-BUS by  doxygen 1.4.4