Exemple #1
0
        private protected unsafe static cef_base_scoped_t *Allocate(int size)
        {
            cef_base_scoped_t *instance = (cef_base_scoped_t *)CefStructure.Allocate(size);

#if NET_LESS_5_0
            instance->del = (void *)Marshal.GetFunctionPointerForDelegate(fnDel);
#else
            instance->del = (delegate * unmanaged[Stdcall] < cef_base_scoped_t *, void >) & DelImpl;
#endif
            return(instance);
        }
        private protected unsafe static cef_base_ref_counted_t *Allocate(int size)
        {
            cef_base_ref_counted_t *instance = (cef_base_ref_counted_t *)CefStructure.Allocate(size);

#if NET_LESS_5_0
            instance->add_ref              = (void *)Marshal.GetFunctionPointerForDelegate(fnAddRef);
            instance->release              = (void *)Marshal.GetFunctionPointerForDelegate(fnRelease);
            instance->has_one_ref          = (void *)Marshal.GetFunctionPointerForDelegate(fnHasOneRef);
            instance->has_at_least_one_ref = (void *)Marshal.GetFunctionPointerForDelegate(fnHasAtLeastOneRef);
#else
            instance->add_ref              = (delegate * unmanaged[Stdcall] < cef_base_ref_counted_t *, void >) & AddRefImpl;
            instance->release              = (delegate * unmanaged[Stdcall] < cef_base_ref_counted_t *, int >) & ReleaseImpl;
            instance->has_one_ref          = (delegate * unmanaged[Stdcall] < cef_base_ref_counted_t *, int >) & HasOneRefImpl;
            instance->has_at_least_one_ref = (delegate * unmanaged[Stdcall] < cef_base_ref_counted_t *, int >) & HasAtLeastOneRefImpl;
#endif
            return(instance);
        }