コード例 #1
0
 static void OverrideProxied(GLib.GType gtype, ProxiedNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("proxied"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
コード例 #2
0
        private void InternalProxied(GES.Asset proxy)
        {
            ProxiedNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("proxied"));
                unmanaged = (ProxiedNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ProxiedNativeDelegate));
            }
            if (unmanaged == null)
            {
                return;
            }

            unmanaged(this.Handle, proxy == null ? IntPtr.Zero : proxy.Handle);
        }