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
- BindingsCollection.cs
- EnumBuilder.cs
- documentsequencetextcontainer.cs
- Base64Encoder.cs
- AuthorizationSection.cs
- WebEncodingValidator.cs
- SendReply.cs
- XPathExpr.cs
- SHA1CryptoServiceProvider.cs
- ProjectionCamera.cs
- AuthenticationService.cs
- SBCSCodePageEncoding.cs
- TypeElementCollection.cs
- BindableTemplateBuilder.cs
- PersonalizationState.cs
- ProfileModule.cs
- VerticalAlignConverter.cs
- coordinatorscratchpad.cs
- FileDialogCustomPlace.cs
- UpDownBase.cs
- DbConnectionPoolCounters.cs
- GridItemPatternIdentifiers.cs
- PathSegment.cs
- ClientCultureInfo.cs
- PathGradientBrush.cs
- HttpListenerPrefixCollection.cs
- WorkflowServiceHostFactory.cs
- EqualityComparer.cs
- MouseButton.cs
- XmlSequenceWriter.cs
- MediaContext.cs
- DesignSurface.cs
- TextTreeRootTextBlock.cs
- DataSourceHelper.cs
- SimpleApplicationHost.cs
- XmlDataImplementation.cs
- ResourcesChangeInfo.cs
- StylusButtonEventArgs.cs
- PathGeometry.cs
- AdRotatorDesigner.cs
- SymLanguageVendor.cs
- BinaryKeyIdentifierClause.cs
- Border.cs
- PropertyToken.cs
- RenderCapability.cs
- DynamicMethod.cs
- OutputCacheSection.cs
- TextTreeExtractElementUndoUnit.cs
- TransactionProtocol.cs
- DataRow.cs
- ProfileSettingsCollection.cs
- BitmapEffect.cs
- StreamHelper.cs
- ImageMetadata.cs
- _NativeSSPI.cs
- WindowExtensionMethods.cs
- Pen.cs
- WebColorConverter.cs
- UIElementParaClient.cs
- DataKeyCollection.cs
- WebPartVerbsEventArgs.cs
- CalendarDateChangedEventArgs.cs
- MSAANativeProvider.cs
- RowsCopiedEventArgs.cs
- QualificationDataAttribute.cs
- OpacityConverter.cs
- SqlStatistics.cs
- DataPagerField.cs
- ExpressionVisitor.cs
- ClassValidator.cs
- SoapAttributeOverrides.cs
- ProfileBuildProvider.cs
- FlowDocumentView.cs
- ButtonChrome.cs
- GridViewRowPresenter.cs
- ControlPropertyNameConverter.cs
- GetIndexBinder.cs
- Clipboard.cs
- StandardTransformFactory.cs
- StringValidator.cs
- UpdatePanel.cs
- ShaperBuffers.cs
- HttpHandlerActionCollection.cs
- FileClassifier.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- SamlAssertionKeyIdentifierClause.cs
- SourceFileInfo.cs
- MSAANativeProvider.cs
- CannotUnloadAppDomainException.cs
- MailAddress.cs
- OrderPreservingPipeliningMergeHelper.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- ToolBarButtonClickEvent.cs
- PixelFormatConverter.cs
- DesignerUtility.cs
- Comparer.cs
- ACL.cs
- WindowsGraphics2.cs
- CompositeScriptReference.cs
- EntityParameterCollection.cs