aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ThirdParty/SmartThreadPool/WIGStartInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ThirdParty/SmartThreadPool/WIGStartInfo.cs')
-rw-r--r--ThirdParty/SmartThreadPool/WIGStartInfo.cs99
1 files changed, 99 insertions, 0 deletions
diff --git a/ThirdParty/SmartThreadPool/WIGStartInfo.cs b/ThirdParty/SmartThreadPool/WIGStartInfo.cs
new file mode 100644
index 0000000..150317f
--- /dev/null
+++ b/ThirdParty/SmartThreadPool/WIGStartInfo.cs
@@ -0,0 +1,99 @@
1// Ami Bar
2// amibar@gmail.com
3
4namespace Amib.Threading
5{
6 /// <summary>
7 /// Summary description for WIGStartInfo.
8 /// </summary>
9 public class WIGStartInfo
10 {
11 /// <summary>
12 /// Use the caller's security context
13 /// </summary>
14 private bool _useCallerCallContext;
15
16 /// <summary>
17 /// Use the caller's HTTP context
18 /// </summary>
19 private bool _useCallerHttpContext;
20
21 /// <summary>
22 /// Dispose of the state object of a work item
23 /// </summary>
24 private bool _disposeOfStateObjects;
25
26 /// <summary>
27 /// The option to run the post execute
28 /// </summary>
29 private CallToPostExecute _callToPostExecute;
30
31 /// <summary>
32 /// A post execute callback to call when none is provided in
33 /// the QueueWorkItem method.
34 /// </summary>
35 private PostExecuteWorkItemCallback _postExecuteWorkItemCallback;
36
37 /// <summary>
38 /// Indicate the WorkItemsGroup to suspend the handling of the work items
39 /// until the Start() method is called.
40 /// </summary>
41 private bool _startSuspended;
42
43 public WIGStartInfo()
44 {
45 _useCallerCallContext = SmartThreadPool.DefaultUseCallerCallContext;
46 _useCallerHttpContext = SmartThreadPool.DefaultUseCallerHttpContext;
47 _disposeOfStateObjects = SmartThreadPool.DefaultDisposeOfStateObjects;
48 _callToPostExecute = SmartThreadPool.DefaultCallToPostExecute;
49 _postExecuteWorkItemCallback = SmartThreadPool.DefaultPostExecuteWorkItemCallback;
50 _startSuspended = SmartThreadPool.DefaultStartSuspended;
51 }
52
53 public WIGStartInfo(WIGStartInfo wigStartInfo)
54 {
55 _useCallerCallContext = wigStartInfo._useCallerCallContext;
56 _useCallerHttpContext = wigStartInfo._useCallerHttpContext;
57 _disposeOfStateObjects = wigStartInfo._disposeOfStateObjects;
58 _callToPostExecute = wigStartInfo._callToPostExecute;
59 _postExecuteWorkItemCallback = wigStartInfo._postExecuteWorkItemCallback;
60 _startSuspended = wigStartInfo._startSuspended;
61 }
62
63 public bool UseCallerCallContext
64 {
65 get { return _useCallerCallContext; }
66 set { _useCallerCallContext = value; }
67 }
68
69 public bool UseCallerHttpContext
70 {
71 get { return _useCallerHttpContext; }
72 set { _useCallerHttpContext = value; }
73 }
74
75 public bool DisposeOfStateObjects
76 {
77 get { return _disposeOfStateObjects; }
78 set { _disposeOfStateObjects = value; }
79 }
80
81 public CallToPostExecute CallToPostExecute
82 {
83 get { return _callToPostExecute; }
84 set { _callToPostExecute = value; }
85 }
86
87 public PostExecuteWorkItemCallback PostExecuteWorkItemCallback
88 {
89 get { return _postExecuteWorkItemCallback; }
90 set { _postExecuteWorkItemCallback = value; }
91 }
92
93 public bool StartSuspended
94 {
95 get { return _startSuspended; }
96 set { _startSuspended = value; }
97 }
98 }
99}