PDFJS_Promise.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. using System;
  10. namespace Paroxe.PdfRenderer.WebGL
  11. {
  12. public class PDFJS_Promise<T> : IPDFJS_Promise
  13. {
  14. private string m_PromiseHandle;
  15. private bool m_HasResult;
  16. private bool m_HasSucceeded;
  17. private bool m_HasFinished;
  18. private bool m_HasReceivedJSResponse;
  19. private bool m_HasBeenCancelled;
  20. private string m_ObjectHandle;
  21. private T m_Result;
  22. public string PromiseHandle
  23. {
  24. get { return m_PromiseHandle; }
  25. }
  26. public T Result
  27. {
  28. get { return m_Result; }
  29. set
  30. {
  31. m_Result = value;
  32. }
  33. }
  34. public string JSObjectHandle
  35. {
  36. get { return m_ObjectHandle; }
  37. set
  38. {
  39. if (value != m_ObjectHandle)
  40. {
  41. m_ObjectHandle = value;
  42. }
  43. }
  44. }
  45. public bool HasSucceeded
  46. {
  47. get { return m_HasSucceeded; }
  48. set
  49. {
  50. if (value != m_HasSucceeded)
  51. {
  52. m_HasSucceeded = value;
  53. }
  54. }
  55. }
  56. public bool HasFinished
  57. {
  58. get
  59. {
  60. return m_HasFinished;
  61. }
  62. set
  63. {
  64. if (value != m_HasFinished)
  65. {
  66. m_HasFinished = value;
  67. }
  68. }
  69. }
  70. public bool HasReceivedJSResponse
  71. {
  72. get
  73. {
  74. return m_HasReceivedJSResponse;
  75. }
  76. set
  77. {
  78. if (value != m_HasReceivedJSResponse)
  79. {
  80. m_HasReceivedJSResponse = value;
  81. }
  82. }
  83. }
  84. public bool HasBeenCancelled
  85. {
  86. get
  87. {
  88. return m_HasBeenCancelled;
  89. }
  90. set
  91. {
  92. m_HasBeenCancelled = value;
  93. }
  94. }
  95. public PDFJS_Promise()
  96. {
  97. m_PromiseHandle = CreateGUID();
  98. }
  99. private string CreateGUID()
  100. {
  101. return "{" + Guid.NewGuid().ToString() + "}";
  102. }
  103. }
  104. }