WorkItemInfo.cs 2.2 KB

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