1
0

WorkItemInfo.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. namespace Amib.Threading
  2. {
  3. #region WorkItemInfo class
  4. /// <summary>
  5. /// Summary description for WorkItemInfo.
  6. /// </summary>
  7. public class WorkItemInfo
  8. {
  9. public WorkItemInfo()
  10. {
  11. UseCallerCallContext = SmartThreadPool.DefaultUseCallerCallContext;
  12. UseCallerHttpContext = SmartThreadPool.DefaultUseCallerHttpContext;
  13. DisposeOfStateObjects = SmartThreadPool.DefaultDisposeOfStateObjects;
  14. CallToPostExecute = SmartThreadPool.DefaultCallToPostExecute;
  15. PostExecuteWorkItemCallback = SmartThreadPool.DefaultPostExecuteWorkItemCallback;
  16. WorkItemPriority = SmartThreadPool.DefaultWorkItemPriority;
  17. }
  18. public WorkItemInfo(WorkItemInfo workItemInfo)
  19. {
  20. UseCallerCallContext = workItemInfo.UseCallerCallContext;
  21. UseCallerHttpContext = workItemInfo.UseCallerHttpContext;
  22. DisposeOfStateObjects = workItemInfo.DisposeOfStateObjects;
  23. CallToPostExecute = workItemInfo.CallToPostExecute;
  24. PostExecuteWorkItemCallback = workItemInfo.PostExecuteWorkItemCallback;
  25. WorkItemPriority = workItemInfo.WorkItemPriority;
  26. Timeout = workItemInfo.Timeout;
  27. }
  28. /// <summary>
  29. /// Get/Set if to use the caller's security context
  30. /// </summary>
  31. public bool UseCallerCallContext { get; set; }
  32. /// <summary>
  33. /// Get/Set if to use the caller's HTTP context
  34. /// </summary>
  35. public bool UseCallerHttpContext { get; set; }
  36. /// <summary>
  37. /// Get/Set if to dispose of the state object of a work item
  38. /// </summary>
  39. public bool DisposeOfStateObjects { get; set; }
  40. /// <summary>
  41. /// Get/Set the run the post execute options
  42. /// </summary>
  43. public CallToPostExecute CallToPostExecute { get; set; }
  44. /// <summary>
  45. /// Get/Set the post execute callback
  46. /// </summary>
  47. public PostExecuteWorkItemCallback PostExecuteWorkItemCallback { get; set; }
  48. /// <summary>
  49. /// Get/Set the work item's priority
  50. /// </summary>
  51. public WorkItemPriority WorkItemPriority { get; set; }
  52. /// <summary>
  53. /// Get/Set the work item's timout in milliseconds.
  54. /// This is a passive timout. When the timout expires the work item won't be actively aborted!
  55. /// </summary>
  56. public long Timeout { get; set; }
  57. }
  58. #endregion
  59. }