Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / RunTime / WorkflowEventArgs.cs / 1305376 / WorkflowEventArgs.cs
// **************************************************************************** // 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 { public class WorkflowEventArgs : EventArgs { private WorkflowInstance _instance; internal WorkflowEventArgs(WorkflowInstance instance) { _instance = instance; } public WorkflowInstance WorkflowInstance { get { return _instance; } } } public class WorkflowCompletedEventArgs : WorkflowEventArgs { private Dictionary_outputParameters; private Activity _originalWorkflowDefinition; private Activity _workflowDefinition; internal WorkflowCompletedEventArgs(WorkflowInstance instance, Activity workflowDefinition) : base(instance) { this._outputParameters = new Dictionary (); this._originalWorkflowDefinition = workflowDefinition; this._workflowDefinition = null; } public Dictionary 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 [....] 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; } } } 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; } } } 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; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. // **************************************************************************** // 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 { public class WorkflowEventArgs : EventArgs { private WorkflowInstance _instance; internal WorkflowEventArgs(WorkflowInstance instance) { _instance = instance; } public WorkflowInstance WorkflowInstance { get { return _instance; } } } public class WorkflowCompletedEventArgs : WorkflowEventArgs { private Dictionary _outputParameters; private Activity _originalWorkflowDefinition; private Activity _workflowDefinition; internal WorkflowCompletedEventArgs(WorkflowInstance instance, Activity workflowDefinition) : base(instance) { this._outputParameters = new Dictionary (); this._originalWorkflowDefinition = workflowDefinition; this._workflowDefinition = null; } public Dictionary 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 [....] 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; } } } 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; } } } 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; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HttpHandlerActionCollection.cs
- CompressEmulationStream.cs
- PropertyMap.cs
- DropDownList.cs
- DbParameterCollection.cs
- DbConnectionFactory.cs
- SQLRoleProvider.cs
- RegexCompiler.cs
- DSASignatureFormatter.cs
- ActiveXHost.cs
- RichTextBoxAutomationPeer.cs
- WpfGeneratedKnownProperties.cs
- PartialClassGenerationTask.cs
- WindowsStartMenu.cs
- RecognitionEventArgs.cs
- SqlNode.cs
- XPathArrayIterator.cs
- cookie.cs
- SiteMapNodeCollection.cs
- WebPartConnectionsCancelEventArgs.cs
- SettingsPropertyValue.cs
- TextViewBase.cs
- SevenBitStream.cs
- ObjectQueryState.cs
- ApplicationHost.cs
- SingleAnimationBase.cs
- ExtensionMethods.cs
- ClientSettingsStore.cs
- TextSelection.cs
- SqlHelper.cs
- MetadataUtilsSmi.cs
- CounterNameConverter.cs
- CommandField.cs
- MemoryRecordBuffer.cs
- MatrixAnimationBase.cs
- NameTable.cs
- CommandDevice.cs
- TraversalRequest.cs
- CodeObjectCreateExpression.cs
- UnknownWrapper.cs
- ECDiffieHellmanCngPublicKey.cs
- GeometryHitTestResult.cs
- GridItemPattern.cs
- SHA384Managed.cs
- DataError.cs
- FrameworkElementAutomationPeer.cs
- ProfileModule.cs
- figurelength.cs
- FileNotFoundException.cs
- ResourceReferenceExpressionConverter.cs
- SectionXmlInfo.cs
- GlyphsSerializer.cs
- TreeNodeMouseHoverEvent.cs
- ReadOnlyHierarchicalDataSource.cs
- externdll.cs
- MetaData.cs
- DbConnectionPoolGroupProviderInfo.cs
- DataBoundControl.cs
- DisplayNameAttribute.cs
- WorkflowLayouts.cs
- Relationship.cs
- basevalidator.cs
- XmlWriter.cs
- RectIndependentAnimationStorage.cs
- InputElement.cs
- InternalBase.cs
- UIInitializationException.cs
- MediaEntryAttribute.cs
- PropertyReferenceSerializer.cs
- FaultContractInfo.cs
- Camera.cs
- SqlCommandAsyncResult.cs
- PointCollection.cs
- XmlnsDictionary.cs
- RequestCacheValidator.cs
- __Error.cs
- XmlSchemaGroup.cs
- _AutoWebProxyScriptWrapper.cs
- XmlDocumentSerializer.cs
- Pen.cs
- ProviderUtil.cs
- TimeEnumHelper.cs
- TimeManager.cs
- Material.cs
- DelayedRegex.cs
- XPathEmptyIterator.cs
- TextElementEnumerator.cs
- RoleManagerModule.cs
- ResourceReferenceExpressionConverter.cs
- Win32MouseDevice.cs
- AuthenticationServiceManager.cs
- JsonDeserializer.cs
- RbTree.cs
- ElementFactory.cs
- CodeAccessPermission.cs
- InvokeMethodActivityDesigner.cs
- Metadata.cs
- HtmlFormWrapper.cs
- BamlLocalizer.cs
- TimeSpanMinutesConverter.cs