private void CheckSelf(cef_string_visitor_t *self) { if (_self != self) { throw ExceptionBuilder.InvalidSelfReference(); } }
public unsafe void GetText(cef_string_visitor_t *visitor) { fixed(cef_frame_t *self = &this) { ((delegate * unmanaged[Stdcall] < cef_frame_t *, cef_string_visitor_t *, void >)get_text)(self, visitor); } }
protected virtual void Dispose(bool disposing) { if (_self != null) { cef_string_visitor_t.Free(_self); _self = null; } }
public CefStringVisitor() { cef_string_visitor_t *self = this.NativeInstance; #if NET_LESS_5_0 self->visit = (void *)Marshal.GetFunctionPointerForDelegate(fnVisit); #else self->visit = (delegate * unmanaged[Stdcall] < cef_string_visitor_t *, cef_string_t *, void >) & VisitImpl; #endif }
private static unsafe void VisitImpl(cef_string_visitor_t *self, cef_string_t * @string) { var instance = GetInstance((IntPtr)self) as CefStringVisitor; if (instance == null || ((ICefStringVisitorPrivate)instance).AvoidVisit()) { return; } instance.Visit(CefString.Read(@string)); }
private void add_ref(cef_string_visitor_t *self) { lock (SyncRoot) { var result = ++_refct; if (result == 1) { lock (_roots) { _roots.Add((IntPtr)_self, this); } } } }
private int release(cef_string_visitor_t *self) { lock (SyncRoot) { var result = --_refct; if (result == 0) { lock (_roots) { _roots.Remove((IntPtr)_self); } } return(result); } }
protected CefStringVisitor() { _self = cef_string_visitor_t.Alloc(); _ds0 = new cef_string_visitor_t.add_ref_delegate(add_ref); _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0); _ds1 = new cef_string_visitor_t.release_delegate(release); _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1); _ds2 = new cef_string_visitor_t.has_one_ref_delegate(has_one_ref); _self->_base._has_one_ref = Marshal.GetFunctionPointerForDelegate(_ds2); _ds3 = new cef_string_visitor_t.visit_delegate(visit); _self->_visit = Marshal.GetFunctionPointerForDelegate(_ds3); }
public static void get_text(cef_frame_t *self, cef_string_visitor_t *visitor) { get_text_delegate d; var p = self->_get_text; if (p == _pd) { d = _dd; } else { d = (get_text_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_text_delegate)); if (_pd == IntPtr.Zero) { _dd = d; _pd = p; } } d(self, visitor); }
private int has_at_least_one_ref(cef_string_visitor_t *self) { lock (SyncRoot) { return(_refct != 0 ? 1 : 0); } }
private int has_one_ref(cef_string_visitor_t *self) { lock (SyncRoot) { return(_refct == 1 ? 1 : 0); } }
/// <summary> /// Retrieve this frame's HTML source as a string sent to the specified /// visitor. /// </summary> public void GetSource(cef_string_visitor_t *visitor) { throw new NotImplementedException(); // TODO: CefFrame.GetSource }
public CefStringVisitor() { cef_string_visitor_t *self = this.NativeInstance; self->visit = (void *)Marshal.GetFunctionPointerForDelegate(fnVisit); }
internal static void Free(cef_string_visitor_t *ptr) { Marshal.FreeHGlobal((IntPtr)ptr); }
private void visit(cef_string_visitor_t *self, cef_string_t * @string) { CheckSelf(self); Visit(cef_string_t.ToString(@string)); }
public unsafe extern void GetText(cef_string_visitor_t *visitor);
public unsafe extern void GetSource(cef_string_visitor_t *visitor);
private int get_refct(cef_string_visitor_t *self) { return(_refct); }
public CefStringVisitor(cef_string_visitor_t *instance) : base((cef_base_ref_counted_t *)instance) { }
private void visit(cef_string_visitor_t *self, cef_string_t * @string) { CheckSelf(self); throw new NotImplementedException(); // TODO: CefStringVisitor.Visit }