コード例 #1
0
 static void OverrideTagAdded(GLib.GType gtype, TagAddedNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("tag_added"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
コード例 #2
0
        private void InternalTagAdded(Gtk.TextTag tag)
        {
            TagAddedNativeDelegate unmanaged = class_abi.BaseOverride <TagAddedNativeDelegate>(this.LookupGType(), "tag_added");

            if (unmanaged == null)
            {
                return;
            }

            unmanaged(this.Handle, tag == null ? IntPtr.Zero : tag.Handle);
        }
コード例 #3
0
        private void InternalTagAdded(Gtk.TextTag tag)
        {
            TagAddedNativeDelegate unmanaged = null;

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

            unmanaged(this.Handle, tag == null ? IntPtr.Zero : tag.Handle);
        }
コード例 #4
0
ファイル: TextTagTable.cs プロジェクト: akrisiun/gtk-sharp
		static void OverrideTagAdded (GLib.GType gtype, TagAddedNativeDelegate callback)
		{
			GtkTextTagTableClass class_iface = GetClassStruct (gtype, false);
			class_iface.TagAdded = callback;
			OverrideClassStruct (gtype, class_iface);
		}