1
0

WorkItemInfo.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. DisposeOfStateObjects = SmartThreadPool.DefaultDisposeOfStateObjects;
  13. CallToPostExecute = SmartThreadPool.DefaultCallToPostExecute;
  14. PostExecuteWorkItemCallback = SmartThreadPool.DefaultPostExecuteWorkItemCallback;
  15. }
  16. public WorkItemInfo(WorkItemInfo workItemInfo)
  17. {
  18. UseCallerCallContext = workItemInfo.UseCallerCallContext;
  19. DisposeOfStateObjects = workItemInfo.DisposeOfStateObjects;
  20. CallToPostExecute = workItemInfo.CallToPostExecute;
  21. PostExecuteWorkItemCallback = workItemInfo.PostExecuteWorkItemCallback;
  22. Timeout = workItemInfo.Timeout;
  23. }
  24. /// <summary>
  25. /// Get/Set if to use the caller's security context
  26. /// </summary>
  27. public bool UseCallerCallContext { get; set; }
  28. /// <summary>
  29. /// Get/Set if to dispose of the state object of a work item
  30. /// </summary>
  31. public bool DisposeOfStateObjects { get; set; }
  32. /// <summary>
  33. /// Get/Set the run the post execute options
  34. /// </summary>
  35. public CallToPostExecute CallToPostExecute { get; set; }
  36. /// <summary>
  37. /// Get/Set the post execute callback
  38. /// </summary>
  39. public PostExecuteWorkItemCallback PostExecuteWorkItemCallback { get; set; }
  40. /// <summary>
  41. /// Get/Set the work item's timout in milliseconds.
  42. /// This is a passive timout. When the timout expires the work item won't be actively aborted!
  43. /// </summary>
  44. public long Timeout { get; set; }
  45. }
  46. #endregion
  47. }