예제 #1
0
 static void OverrideParseName(GLib.GType gtype, ParseNameNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("parse_name"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
예제 #2
0
        private GLib.IFile InternalParseName(string parse_name)
        {
            ParseNameNativeDelegate unmanaged = class_abi.BaseOverride <ParseNameNativeDelegate>(this.LookupGType(), "parse_name");

            if (unmanaged == null)
            {
                return(null);
            }

            IntPtr native_parse_name = GLib.Marshaller.StringToPtrGStrdup(parse_name);
            IntPtr __result          = unmanaged(this.Handle, native_parse_name);

            GLib.Marshaller.Free(native_parse_name);
            return(GLib.FileAdapter.GetObject(__result, false));
        }
예제 #3
0
        private GLib.IFile InternalParseName(string parse_name)
        {
            ParseNameNativeDelegate unmanaged = null;

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

            IntPtr native_parse_name = GLib.Marshaller.StringToPtrGStrdup(parse_name);
            IntPtr __result          = unmanaged(this.Handle, native_parse_name);

            GLib.Marshaller.Free(native_parse_name);
            return(GLib.FileAdapter.GetObject(__result, false));
        }
예제 #4
0
파일: Vfs.cs 프로젝트: akrisiun/gtk-sharp
		static void OverrideParseName (GLib.GType gtype, ParseNameNativeDelegate callback)
		{
			GVfsClass class_iface = GetClassStruct (gtype, false);
			class_iface.ParseName = callback;
			OverrideClassStruct (gtype, class_iface);
		}