1
0

WIGStartInfo.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // Ami Bar
  2. // [email protected]
  3. namespace Amib.Threading
  4. {
  5. /// <summary>
  6. /// Summary description for WIGStartInfo.
  7. /// </summary>
  8. public class WIGStartInfo
  9. {
  10. /// <summary>
  11. /// Use the caller's security context
  12. /// </summary>
  13. private bool _useCallerCallContext;
  14. /// <summary>
  15. /// Use the caller's HTTP context
  16. /// </summary>
  17. private bool _useCallerHttpContext;
  18. /// <summary>
  19. /// Dispose of the state object of a work item
  20. /// </summary>
  21. private bool _disposeOfStateObjects;
  22. /// <summary>
  23. /// The option to run the post execute
  24. /// </summary>
  25. private CallToPostExecute _callToPostExecute;
  26. /// <summary>
  27. /// A post execute callback to call when none is provided in
  28. /// the QueueWorkItem method.
  29. /// </summary>
  30. private PostExecuteWorkItemCallback _postExecuteWorkItemCallback;
  31. /// <summary>
  32. /// Indicate the WorkItemsGroup to suspend the handling of the work items
  33. /// until the Start() method is called.
  34. /// </summary>
  35. private bool _startSuspended;
  36. public WIGStartInfo()
  37. {
  38. _useCallerCallContext = SmartThreadPool.DefaultUseCallerCallContext;
  39. _useCallerHttpContext = SmartThreadPool.DefaultUseCallerHttpContext;
  40. _disposeOfStateObjects = SmartThreadPool.DefaultDisposeOfStateObjects;
  41. _callToPostExecute = SmartThreadPool.DefaultCallToPostExecute;
  42. _postExecuteWorkItemCallback = SmartThreadPool.DefaultPostExecuteWorkItemCallback;
  43. _startSuspended = SmartThreadPool.DefaultStartSuspended;
  44. }
  45. public WIGStartInfo(WIGStartInfo wigStartInfo)
  46. {
  47. _useCallerCallContext = wigStartInfo._useCallerCallContext;
  48. _useCallerHttpContext = wigStartInfo._useCallerHttpContext;
  49. _disposeOfStateObjects = wigStartInfo._disposeOfStateObjects;
  50. _callToPostExecute = wigStartInfo._callToPostExecute;
  51. _postExecuteWorkItemCallback = wigStartInfo._postExecuteWorkItemCallback;
  52. _startSuspended = wigStartInfo._startSuspended;
  53. }
  54. public bool UseCallerCallContext
  55. {
  56. get { return _useCallerCallContext; }
  57. set { _useCallerCallContext = value; }
  58. }
  59. public bool UseCallerHttpContext
  60. {
  61. get { return _useCallerHttpContext; }
  62. set { _useCallerHttpContext = value; }
  63. }
  64. public bool DisposeOfStateObjects
  65. {
  66. get { return _disposeOfStateObjects; }
  67. set { _disposeOfStateObjects = value; }
  68. }
  69. public CallToPostExecute CallToPostExecute
  70. {
  71. get { return _callToPostExecute; }
  72. set { _callToPostExecute = value; }
  73. }
  74. public PostExecuteWorkItemCallback PostExecuteWorkItemCallback
  75. {
  76. get { return _postExecuteWorkItemCallback; }
  77. set { _postExecuteWorkItemCallback = value; }
  78. }
  79. public bool StartSuspended
  80. {
  81. get { return _startSuspended; }
  82. set { _startSuspended = value; }
  83. }
  84. }
  85. }