public static GLib.Object CreateObject(IntPtr raw) { if (raw == IntPtr.Zero) { return(null); } Type type = GetTypeOrParent(raw); if (type == null) { return(null); } GLib.Object obj; try { obj = FastActivator.CreateObject(raw, type); } catch (MissingMethodException) { throw new GLib.MissingIntPtrCtorException("GLib.Object subclass " + type + " must provide a protected or public IntPtr ctor to support wrapping of native object handles."); } return(obj); }