Ejemplo n.º 1
0
        /// <summary>
        /// Returns the document element with the specified ID value.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_dom_capi.h">cef/include/capi/cef_dom_capi.h</see>.
        /// </remarks>
        public CfxDomNode GetElementById(string id)
        {
            var id_pinned = new PinnedString(id);
            var __retval  = CfxApi.DomDocument.cfx_domdocument_get_element_by_id(NativePtr, id_pinned.Obj.PinnedPtr, id_pinned.Length);

            id_pinned.Obj.Free();
            return(CfxDomNode.Wrap(__retval));
        }
Ejemplo n.º 2
0
 internal static CfxDomNode Wrap(IntPtr nativePtr)
 {
     if (nativePtr == IntPtr.Zero)
     {
         return(null);
     }
     lock (weakCache) {
         var wrapper = (CfxDomNode)weakCache.Get(nativePtr);
         if (wrapper == null)
         {
             wrapper = new CfxDomNode(nativePtr);
             weakCache.Add(wrapper);
         }
         else
         {
             CfxApi.cfx_release(nativePtr);
         }
         return(wrapper);
     }
 }
Ejemplo n.º 3
0
 internal static CfxDomNode Wrap(IntPtr nativePtr)
 {
     if(nativePtr == IntPtr.Zero) return null;
     lock(weakCache) {
         var wrapper = (CfxDomNode)weakCache.Get(nativePtr);
         if(wrapper == null) {
             wrapper = new CfxDomNode(nativePtr);
             weakCache.Add(wrapper);
         } else {
             CfxApi.cfx_release(nativePtr);
         }
         return wrapper;
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Returns true (1) if this object is pointing to the same handle as |that|
 /// object.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_dom_capi.h">cef/include/capi/cef_dom_capi.h</see>.
 /// </remarks>
 public bool IsSame(CfxDomNode that)
 {
     return 0 != CfxApi.cfx_domnode_is_same(NativePtr, CfxDomNode.Unwrap(that));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Returns true (1) if this object is pointing to the same handle as |that|
 /// object.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_dom_capi.h">cef/include/capi/cef_dom_capi.h</see>.
 /// </remarks>
 public bool IsSame(CfxDomNode that)
 {
     return(0 != CfxApi.DomNode.cfx_domnode_is_same(NativePtr, CfxDomNode.Unwrap(that)));
 }