Пример #1
0
 static void OverrideBegin(GLib.GType gtype, BeginNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("begin"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Пример #2
0
        private void InternalBegin()
        {
            BeginNativeDelegate unmanaged = class_abi.BaseOverride <BeginNativeDelegate>(this.LookupGType(), "begin");

            if (unmanaged == null)
            {
                return;
            }

            unmanaged(this.Handle);
        }
Пример #3
0
        private void InternalBegin()
        {
            BeginNativeDelegate unmanaged = null;

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

            unmanaged(this.Handle);
        }