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
- SerializationUtility.cs
- SafeNativeMethods.cs
- CustomValidator.cs
- WebPartConnectionsCancelVerb.cs
- Psha1DerivedKeyGeneratorHelper.cs
- Keyboard.cs
- EditingCommands.cs
- RecommendedAsConfigurableAttribute.cs
- LinqDataSourceUpdateEventArgs.cs
- SecurityContextCookieSerializer.cs
- StateWorkerRequest.cs
- WebBrowserUriTypeConverter.cs
- NullRuntimeConfig.cs
- TrustManagerMoreInformation.cs
- SerializerWriterEventHandlers.cs
- BaseContextMenu.cs
- PropertyInfo.cs
- SortableBindingList.cs
- DictionaryMarkupSerializer.cs
- LogicalExpr.cs
- CaseInsensitiveOrdinalStringComparer.cs
- MethodBody.cs
- JavaScriptSerializer.cs
- BaseComponentEditor.cs
- XmlSchemaDocumentation.cs
- XmlAnyElementAttributes.cs
- WebPartZone.cs
- XsltLoader.cs
- Activator.cs
- MD5CryptoServiceProvider.cs
- SystemIPGlobalProperties.cs
- PrivilegedConfigurationManager.cs
- FusionWrap.cs
- DesignerCategoryAttribute.cs
- DictionaryBase.cs
- BindingBase.cs
- CustomWebEventKey.cs
- ValidationManager.cs
- SessionIDManager.cs
- LinqDataSourceHelper.cs
- LinkConverter.cs
- webbrowsersite.cs
- XmlnsDictionary.cs
- FunctionQuery.cs
- controlskin.cs
- CommonDialog.cs
- TreeViewDataItemAutomationPeer.cs
- PrivateFontCollection.cs
- CodeCompiler.cs
- XPathAncestorIterator.cs
- UniqueContractNameValidationBehavior.cs
- BoolExpressionVisitors.cs
- OdbcEnvironment.cs
- NamedElement.cs
- sqlstateclientmanager.cs
- TableLayoutStyle.cs
- XmlAnyElementAttribute.cs
- DSASignatureDeformatter.cs
- BuildProvidersCompiler.cs
- _TLSstream.cs
- ProfessionalColorTable.cs
- ExpressionContext.cs
- WebServiceHostFactory.cs
- DataObjectCopyingEventArgs.cs
- DocumentXmlWriter.cs
- HashMembershipCondition.cs
- ListParagraph.cs
- Journal.cs
- TreeNodeEventArgs.cs
- CanonicalFormWriter.cs
- WindowsGraphicsWrapper.cs
- Wildcard.cs
- AnimationLayer.cs
- altserialization.cs
- _AutoWebProxyScriptEngine.cs
- ClonableStack.cs
- ProtocolsSection.cs
- SqlDependency.cs
- NegotiationTokenAuthenticator.cs
- XmlTypeAttribute.cs
- PresentationAppDomainManager.cs
- RecognitionEventArgs.cs
- RootBrowserWindowAutomationPeer.cs
- MapPathBasedVirtualPathProvider.cs
- PartialClassGenerationTaskInternal.cs
- VariableQuery.cs
- RegionIterator.cs
- WindowsSysHeader.cs
- RecognizedWordUnit.cs
- TdsParserSafeHandles.cs
- SqlStatistics.cs
- ContentIterators.cs
- SurrogateEncoder.cs
- StateBag.cs
- Internal.cs
- XmlNodeReader.cs
- SqlRowUpdatingEvent.cs
- TextParagraphProperties.cs
- _NegoState.cs
- FamilyMapCollection.cs