1 using System;
2 using System.Collections;
3 using System.Collections.Generic;
4 using System.Workflow.ComponentModel;
5 using System.Runtime.Serialization;
6 using System.Security.Permissions;
7 using System.Workflow.Runtime.Hosting;
8 
9 namespace System.Workflow.Runtime.Tracking
10 {
11     [Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
12     public abstract class TrackingRecord
13     {
TrackingRecord()14         protected TrackingRecord()
15         {
16         }
17 
18         public abstract DateTime EventDateTime
19         {
20             get;
21             set;
22         }
23 
24         public abstract int EventOrder
25         {
26             get;
27             set;
28         }
29 
30         public abstract EventArgs EventArgs
31         {
32             get;
33             set;
34         }
35 
36         public abstract TrackingAnnotationCollection Annotations
37         {
38             get;
39         }
40     }
41 
42     /// <summary>
43     /// Contains data for a specific extraction point.
44     /// </summary>
45     [Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
46     public class ActivityTrackingRecord : TrackingRecord
47     {
48         #region Data Members
49 
50         private string _qualifiedID = null;
51         private Type _activityType = null;
52         private ActivityExecutionStatus _status;
53         private List<TrackingDataItem> _body = new List<TrackingDataItem>();
54         private Guid _contextGuid = Guid.Empty, _parentContextGuid = Guid.Empty;
55 
56         private DateTime _eventDateTime = DateTime.MinValue;
57         private int _eventOrder = -1;
58         private EventArgs _args = null;
59         private TrackingAnnotationCollection _annotations = new TrackingAnnotationCollection();
60 
61         #endregion
62 
63         #region Constructors
64 
ActivityTrackingRecord()65         public ActivityTrackingRecord()
66         {
67         }
68 
ActivityTrackingRecord(Type activityType, string qualifiedName, Guid contextGuid, Guid parentContextGuid, ActivityExecutionStatus executionStatus, DateTime eventDateTime, int eventOrder, EventArgs eventArgs)69         public ActivityTrackingRecord(Type activityType, string qualifiedName, Guid contextGuid, Guid parentContextGuid, ActivityExecutionStatus executionStatus, DateTime eventDateTime, int eventOrder, EventArgs eventArgs)
70         {
71             _activityType = activityType;
72             _qualifiedID = qualifiedName;
73             _status = executionStatus;
74             _eventDateTime = eventDateTime;
75             _contextGuid = contextGuid;
76             _parentContextGuid = parentContextGuid;
77             _eventOrder = eventOrder;
78             _args = eventArgs;
79         }
80 
81         #endregion
82 
83         #region Public Properties
84 
85         public string QualifiedName
86         {
87             get { return _qualifiedID; }
88             set { _qualifiedID = value; }
89         }
90 
91         public Guid ContextGuid
92         {
93             get { return _contextGuid; }
94             set { _contextGuid = value; }
95         }
96 
97         public Guid ParentContextGuid
98         {
99             get { return _parentContextGuid; }
100             set { _parentContextGuid = value; }
101         }
102 
103         public Type ActivityType
104         {
105             get { return _activityType; }
106             set { _activityType = value; }
107         }
108 
109         public ActivityExecutionStatus ExecutionStatus
110         {
111             get { return _status; }
112             set { _status = value; }
113         }
114 
115         public IList<TrackingDataItem> Body
116         {
117             get { return _body; }
118         }
119 
120         #endregion
121 
122         #region TrackingRecord
123 
124         public override DateTime EventDateTime
125         {
126             get { return _eventDateTime; }
127             set { _eventDateTime = value; }
128         }
129         /// <summary>
130         /// Contains a value indicating the relative order of this event within the context of a workflow instance.
131         /// Value will be unique within a workflow instance but is not guaranteed to be sequential.
132         /// </summary>
133         public override int EventOrder
134         {
135             get { return _eventOrder; }
136             set { _eventOrder = value; }
137         }
138 
139         public override EventArgs EventArgs
140         {
141             get { return _args; }
142             set { _args = value; }
143         }
144 
145         public override TrackingAnnotationCollection Annotations
146         {
147             get { return _annotations; }
148         }
149 
150         #endregion
151     }
152 
153     [Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
154     public class UserTrackingRecord : TrackingRecord
155     {
156         #region Data Members
157 
158         private string _qualifiedID = null;
159         private Type _activityType = null;
160         private List<TrackingDataItem> _body = new List<TrackingDataItem>();
161         private Guid _contextGuid = Guid.Empty, _parentContextGuid = Guid.Empty;
162 
163         private DateTime _eventDateTime = DateTime.MinValue;
164         private int _eventOrder = -1;
165         private object _userData = null;
166         private TrackingAnnotationCollection _annotations = new TrackingAnnotationCollection();
167         private EventArgs _args = null;
168         private string _key = null;
169 
170         #endregion
171 
172         #region Constructors
173 
UserTrackingRecord()174         public UserTrackingRecord()
175         {
176         }
177 
UserTrackingRecord(Type activityType, string qualifiedName, Guid contextGuid, Guid parentContextGuid, DateTime eventDateTime, int eventOrder, string userDataKey, object userData)178         public UserTrackingRecord(Type activityType, string qualifiedName, Guid contextGuid, Guid parentContextGuid, DateTime eventDateTime, int eventOrder, string userDataKey, object userData)
179         {
180             _activityType = activityType;
181             _qualifiedID = qualifiedName;
182             _eventDateTime = eventDateTime;
183             _contextGuid = contextGuid;
184             _parentContextGuid = parentContextGuid;
185             _eventOrder = eventOrder;
186             _userData = userData;
187             _key = userDataKey;
188         }
189 
190         #endregion
191 
192         #region Public Properties
193 
194         public string QualifiedName
195         {
196             get { return _qualifiedID; }
197             set { _qualifiedID = value; }
198         }
199 
200         public Guid ContextGuid
201         {
202             get { return _contextGuid; }
203             set { _contextGuid = value; }
204         }
205 
206         public Guid ParentContextGuid
207         {
208             get { return _parentContextGuid; }
209             set { _parentContextGuid = value; }
210         }
211 
212         public Type ActivityType
213         {
214             get { return _activityType; }
215             set { _activityType = value; }
216         }
217 
218         public IList<TrackingDataItem> Body
219         {
220             get { return _body; }
221         }
222 
223         public string UserDataKey
224         {
225             get { return _key; }
226             set { _key = value; }
227         }
228 
229         public object UserData
230         {
231             get { return _userData; }
232             set { _userData = value; }
233         }
234 
235         #endregion
236 
237         #region TrackingRecord
238 
239         public override DateTime EventDateTime
240         {
241             get { return _eventDateTime; }
242             set { _eventDateTime = value; }
243         }
244         /// <summary>
245         /// Contains a value indicating the relative order of this event within the context of a workflow instance.
246         /// Value will be unique within a workflow instance but is not guaranteed to be sequential.
247         /// </summary>
248         public override int EventOrder
249         {
250             get { return _eventOrder; }
251             set { _eventOrder = value; }
252         }
253 
254         public override TrackingAnnotationCollection Annotations
255         {
256             get { return _annotations; }
257         }
258 
259         public override EventArgs EventArgs
260         {
261             get { return _args; }
262             set { _args = value; }
263         }
264 
265         #endregion
266     }
267 
268     [Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
269     public class WorkflowTrackingRecord : TrackingRecord
270     {
271         #region Private Data Members
272 
273         private TrackingWorkflowEvent _event;
274         private DateTime _eventDateTime = DateTime.MinValue;
275         private int _eventOrder = -1;
276         private EventArgs _args = null;
277         private TrackingAnnotationCollection _annotations = new TrackingAnnotationCollection();
278 
279         #endregion
280 
281         #region Constructors
282 
WorkflowTrackingRecord()283         public WorkflowTrackingRecord()
284         {
285         }
286 
WorkflowTrackingRecord(TrackingWorkflowEvent trackingWorkflowEvent, DateTime eventDateTime, int eventOrder, EventArgs eventArgs)287         public WorkflowTrackingRecord(TrackingWorkflowEvent trackingWorkflowEvent, DateTime eventDateTime, int eventOrder, EventArgs eventArgs)
288         {
289             _event = trackingWorkflowEvent;
290             _eventDateTime = eventDateTime;
291             _eventOrder = eventOrder;
292             _args = eventArgs;
293         }
294 
295         #endregion
296 
297         #region TrackingRecord
298 
299         public TrackingWorkflowEvent TrackingWorkflowEvent
300         {
301             get { return _event; }
302             set { _event = value; }
303         }
304 
305         public override DateTime EventDateTime
306         {
307             get { return _eventDateTime; }
308             set { _eventDateTime = value; }
309         }
310         /// <summary>
311         /// Contains a value indicating the relative order of this event within the context of a workflow instance.
312         /// Value will be unique within a workflow instance but is not guaranteed to be sequential.
313         /// </summary>
314         public override int EventOrder
315         {
316             get { return _eventOrder; }
317             set { _eventOrder = value; }
318         }
319 
320         public override EventArgs EventArgs
321         {
322             get { return _args; }
323             set { _args = value; }
324         }
325 
326         public override TrackingAnnotationCollection Annotations
327         {
328             get { return _annotations; }
329         }
330 
331         #endregion
332     }
333 }
334