Пример #1
0
 static void OverrideSetValue(GLib.GType gtype, SetValueNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("set_value"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Пример #2
0
        private void InternalSetValue(out byte value, long length, GLib.DestroyNotify destroy)
        {
            SetValueNativeDelegate unmanaged = class_abi.BaseOverride <SetValueNativeDelegate>(this.LookupGType(), "set_value");

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

            unmanaged(this.Handle, out value, new IntPtr(length), destroy);
        }
Пример #3
0
        private void InternalSetValue(out byte value, long length, GLib.DestroyNotify destroy)
        {
            SetValueNativeDelegate unmanaged = null;

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

            unmanaged(this.Handle, out value, new IntPtr(length), destroy);
        }