Welcome to mirror list, hosted at ThFree Co, Russian Federation.

WorkflowEventArgs.cs « System.Workflow.Runtime « referencesource « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a81dd7b359a15b45ead8152106bc792eb2522a5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// ****************************************************************************
// Copyright (C) Microsoft Corporation.  All rights reserved.
//

using System;
using System.IO;
using System.Threading;
using System.Diagnostics;
using System.Globalization;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;

using System.Workflow.Runtime;
using System.Workflow.ComponentModel;
using System.Workflow.Runtime.Hosting;

namespace System.Workflow.Runtime
{

    [Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
    public class WorkflowEventArgs : EventArgs
    {
        private WorkflowInstance _instance;

        internal WorkflowEventArgs(WorkflowInstance instance)
        {
            _instance = instance;
        }

        public WorkflowInstance WorkflowInstance
        {
            get
            {
                return _instance;
            }
        }
    }

    [Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
    public class WorkflowCompletedEventArgs : WorkflowEventArgs
    {
        private Dictionary<String, Object> _outputParameters;
        private Activity _originalWorkflowDefinition;
        private Activity _workflowDefinition;

        internal WorkflowCompletedEventArgs(WorkflowInstance instance, Activity workflowDefinition)
            : base(instance)
        {
            this._outputParameters = new Dictionary<String, Object>();
            this._originalWorkflowDefinition = workflowDefinition;
            this._workflowDefinition = null;
        }

        public Dictionary<String, Object> OutputParameters
        {
            get
            {
                return this._outputParameters;
            }
        }

        public Activity WorkflowDefinition
        {
            get
            {
                if (this._workflowDefinition == null)
                {
                    using (new WorkflowDefinitionLock(this._originalWorkflowDefinition))
                    {
                        if (this._workflowDefinition == null)
                        {
                            // Clone the original definition after locking the
                            // definition's sync object which was passed in
                            // the constructor.  This is so that the host cannot
                            // corrupt the shared definition
                            Activity tempDefinition = this._originalWorkflowDefinition.Clone();
                            Thread.MemoryBarrier();
                            this._workflowDefinition = tempDefinition;
                        }
                    }
                }

                return this._workflowDefinition;
            }
        }
    }

    [Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
    public class WorkflowSuspendedEventArgs : WorkflowEventArgs
    {
        private String _error;

        internal WorkflowSuspendedEventArgs(WorkflowInstance instance, String error)
            : base(instance)
        {
            this._error = error;
        }

        public String Error
        {
            get
            {
                return this._error;
            }
        }
    }

    [Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
    public class WorkflowTerminatedEventArgs : WorkflowEventArgs
    {
        private Exception exception;

        internal WorkflowTerminatedEventArgs(WorkflowInstance instance, String error)
            : base(instance)
        {
            this.exception = new WorkflowTerminatedException(error);
        }
        internal WorkflowTerminatedEventArgs(WorkflowInstance instance, Exception e)
            : base(instance)
        {
            this.exception = e;
        }

        public Exception Exception
        {
            get
            {
                return this.exception;
            }
        }
    }

    internal sealed class WorkflowDefinitionEventArgs : EventArgs
    {
        private Type _workflowType;
        private byte[] _xomlHashCode;

        internal WorkflowDefinitionEventArgs(Type scheduleType)
        {
            _workflowType = scheduleType;
        }

        internal WorkflowDefinitionEventArgs(byte[] scheduleDefHash)
        {
            _xomlHashCode = scheduleDefHash;
        }

        public Type WorkflowType
        {
            get
            {
                return _workflowType;
            }
        }

        public byte[] WorkflowDefinitionHashCode
        {
            get
            {
                return _xomlHashCode;
            }
        }
    }
}