示例#1
0
 static void OverrideFormatEntryText(GLib.GType gtype, FormatEntryTextNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("format_entry_text"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
示例#2
0
        private string InternalFormatEntryText(string path)
        {
            FormatEntryTextNativeDelegate unmanaged = null;

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

            IntPtr native_path = GLib.Marshaller.StringToPtrGStrdup(path);
            IntPtr __result    = unmanaged(this.Handle, native_path);

            GLib.Marshaller.Free(native_path);
            return(GLib.Marshaller.PtrToStringGFree(__result));
        }