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

            instance->del = (void *)Marshal.GetFunctionPointerForDelegate(fnDel);
            return(instance);
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of <see cref="CefBaseScoped"/> using
 /// the pointer to scaped CEF struct.
 /// </summary>
 /// <param name="instance">The pointer to a scoped CEF struct.</param>
 /// <exception cref="NullReferenceException"><paramref name="instance"/> is null.</exception>
 public CefBaseScoped(cef_base_scoped_t *instance)
 {
     if (instance == null)
     {
         throw new ArgumentNullException(nameof(instance));
     }
     _instance = instance;
 }
示例#3
0
#pragma warning restore CS1591

        private unsafe static void DelImpl(cef_base_scoped_t *self)
        {
            CefBaseScoped instance;

            lock (Scope)
            {
                Scope.TryGetValue((IntPtr)self, out instance);
            }
            ((IDisposable)instance)?.Dispose();
        }
示例#4
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);
        }
示例#5
0
 /// <summary>
 /// Initializes a new instance of <see cref="CefBaseScoped{T}"/> using
 /// the specified pointer to a specified CEF struct.
 /// </summary>
 /// <param name="instance">The pointer to a specified CEF struct.</param>
 public unsafe CefBaseScoped(cef_base_scoped_t *instance)
     : base(instance)
 {
 }
示例#6
0
 internal unsafe CefBaseScopedImpl(cef_base_scoped_t *instance)
     : base(instance)
 {
 }