CefDomVisitor.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. namespace Xilium.CefGlue
  2. {
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Diagnostics;
  6. using System.Runtime.InteropServices;
  7. using Xilium.CefGlue.Interop;
  8. /// <summary>
  9. /// Interface to implement for visiting the DOM. The methods of this class will
  10. /// be called on the render process main thread.
  11. /// </summary>
  12. public abstract unsafe partial class CefDomVisitor
  13. {
  14. private void visit(cef_domvisitor_t* self, cef_domdocument_t* document)
  15. {
  16. CheckSelf(self);
  17. var m_document = CefDomDocument.FromNative(document);
  18. Visit(m_document);
  19. m_document.Dispose();
  20. }
  21. /// <summary>
  22. /// Method executed for visiting the DOM. The document object passed to this
  23. /// method represents a snapshot of the DOM at the time this method is
  24. /// executed. DOM objects are only valid for the scope of this method. Do not
  25. /// keep references to or attempt to access any DOM objects outside the scope
  26. /// of this method.
  27. /// </summary>
  28. protected abstract void Visit(CefDomDocument document);
  29. }
  30. }