コード例 #1
0
 static void OverrideToNative(GLib.GType gtype, ToNativeNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("to_native"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
コード例 #2
0
        private bool InternalToNative(IntPtr dest, ulong destlen)
        {
            ToNativeNativeDelegate unmanaged = class_abi.BaseOverride <ToNativeNativeDelegate>(this.LookupGType(), "to_native");

            if (unmanaged == null)
            {
                throw new InvalidOperationException("No base method to invoke");
            }

            IntPtr error    = IntPtr.Zero;
            bool   __result = unmanaged(this.Handle, dest, new UIntPtr(destlen), out error);

            return(__result);
        }
コード例 #3
0
        private bool InternalToNative(IntPtr dest, ulong destlen)
        {
            ToNativeNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("to_native"));
                unmanaged = (ToNativeNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ToNativeNativeDelegate));
            }
            if (unmanaged == null)
            {
                throw new InvalidOperationException("No base method to invoke");
            }

            IntPtr error    = IntPtr.Zero;
            bool   __result = unmanaged(this.Handle, dest, new UIntPtr(destlen), out error);

            return(__result);
        }
コード例 #4
0
ファイル: SocketAddress.cs プロジェクト: akrisiun/gtk-sharp
		static void OverrideToNative (GLib.GType gtype, ToNativeNativeDelegate callback)
		{
			GSocketAddressClass class_iface = GetClassStruct (gtype, false);
			class_iface.ToNative = callback;
			OverrideClassStruct (gtype, class_iface);
		}