PDFSearchResult.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. http://www.cgsoso.com/forum-211-1.html
  3. CG搜搜 Unity3d 每日Unity3d插件免费更新 更有VIP资源!
  4. CGSOSO 主打游戏开发,影视设计等CG资源素材。
  5. 插件如若商用,请务必官网购买!
  6. daily assets update for try.
  7. U should buy the asset from home store if u use it in your project!
  8. */
  9. namespace Paroxe.PdfRenderer
  10. {
  11. /// <summary>
  12. /// Reprensent a search result. To result location is describe with index of the first char and the length of the result.
  13. /// </summary>
  14. public struct PDFSearchResult
  15. {
  16. private readonly int m_PageIndex;
  17. private readonly int m_StartIndex; // index of the first character
  18. private readonly int m_Count; // number of characters
  19. public PDFSearchResult(int pageIndex, int startIndex, int count)
  20. {
  21. m_PageIndex = pageIndex;
  22. m_StartIndex = startIndex;
  23. m_Count = count;
  24. }
  25. /// <summary>
  26. /// Indicate whether the result is valid or invalid.
  27. /// </summary>
  28. public bool IsValid
  29. {
  30. get { return m_PageIndex != -1; }
  31. }
  32. /// <summary>
  33. /// The pageIndex of the result.
  34. /// </summary>
  35. public int PageIndex
  36. {
  37. get { return m_PageIndex; }
  38. }
  39. /// <summary>
  40. /// The index of the first character of the result within the page.
  41. /// </summary>
  42. public int StartIndex
  43. {
  44. get { return m_StartIndex; }
  45. }
  46. /// <summary>
  47. /// The length of the result within the page.
  48. /// </summary>
  49. public int Count
  50. {
  51. get { return m_Count; }
  52. }
  53. }
  54. }