public DatagramBasedAdapter(IDatagramBasedImplementor implementor)
 {
     if (implementor == null)
     {
         throw new ArgumentNullException("implementor");
     }
     else if (!(implementor is GLib.Object))
     {
         throw new ArgumentException("implementor must be a subclass of GLib.Object");
     }
     this.implementor = implementor as GLib.Object;
 }
 static int ConditionCheck_cb(IntPtr inst, int condition)
 {
     try {
         IDatagramBasedImplementor __obj = GLib.Object.GetObject(inst, false) as IDatagramBasedImplementor;
         GLib.IOCondition          __result;
         __result = __obj.ConditionCheck((GLib.IOCondition)condition);
         return((int)__result);
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, true);
         // NOTREACHED: above call does not return.
         throw e;
     }
 }
 static IntPtr CreateSource_cb(IntPtr inst, int condition, IntPtr cancellable)
 {
     try {
         IDatagramBasedImplementor __obj = GLib.Object.GetObject(inst, false) as IDatagramBasedImplementor;
         GLib.Source __result;
         __result = __obj.CreateSource((GLib.IOCondition)condition, GLib.Object.GetObject(cancellable) as GLib.Cancellable);
         return(__result == null ? IntPtr.Zero : __result.Handle);
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, true);
         // NOTREACHED: above call does not return.
         throw e;
     }
 }
        static int SendMessages_cb(IntPtr inst, IntPtr messages, uint num_messages, int flags, long timeout, IntPtr cancellable, out IntPtr error)
        {
            error = IntPtr.Zero;

            try {
                IDatagramBasedImplementor __obj = GLib.Object.GetObject(inst, false) as IDatagramBasedImplementor;
                int __result;
                __result = __obj.SendMessages(GLib.OutputMessage.New(messages), num_messages, flags, timeout, GLib.Object.GetObject(cancellable) as GLib.Cancellable);
                return(__result);
            } catch (Exception e) {
                GLib.ExceptionManager.RaiseUnhandledException(e, true);
                // NOTREACHED: above call does not return.
                throw e;
            }
        }
        static bool ConditionWait_cb(IntPtr inst, int condition, long timeout, IntPtr cancellable, out IntPtr error)
        {
            error = IntPtr.Zero;

            try {
                IDatagramBasedImplementor __obj = GLib.Object.GetObject(inst, false) as IDatagramBasedImplementor;
                bool __result;
                __result = __obj.ConditionWait((GLib.IOCondition)condition, timeout, GLib.Object.GetObject(cancellable) as GLib.Cancellable);
                return(__result);
            } catch (Exception e) {
                GLib.ExceptionManager.RaiseUnhandledException(e, true);
                // NOTREACHED: above call does not return.
                throw e;
            }
        }