예제 #1
0
 static void OverrideBracketMatched(GLib.GType gtype, BracketMatchedNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("bracket_matched"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
예제 #2
0
        private void InternalBracketMatched(Gtk.TextIter iter, GtkSource.BracketMatchType state)
        {
            BracketMatchedNativeDelegate unmanaged = class_abi.BaseOverride <BracketMatchedNativeDelegate>(this.LookupGType(), "bracket_matched");

            if (unmanaged == null)
            {
                return;
            }

            IntPtr native_iter = GLib.Marshaller.StructureToPtrAlloc(iter);

            unmanaged(this.Handle, native_iter, (int)state);
            Marshal.FreeHGlobal(native_iter);
        }