Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Behaviors / CancellationHandler.cs / 1305376 / CancellationHandler.cs
namespace System.Workflow.ComponentModel { using System; using System.Drawing; using System.ComponentModel; using System.Collections; using System.ComponentModel.Design; using System.Workflow.ComponentModel.Design; using System.Workflow.ComponentModel.Compiler; [ToolboxItem(false)] [Designer(typeof(CancellationHandlerActivityDesigner), typeof(IDesigner))] [ToolboxBitmap(typeof(CancellationHandlerActivity), "Resources.CancellationHandler.bmp")] [ActivityValidator(typeof(CancellationHandlerValidator))] [AlternateFlowActivity] public sealed class CancellationHandlerActivity : CompositeActivity, IActivityEventListener{ public CancellationHandlerActivity() { } public CancellationHandlerActivity(string name) :base(name) { } protected internal override void Initialize(IServiceProvider provider) { if (this.Parent == null) throw new InvalidOperationException(SR.GetString(SR.Error_MustHaveParent)); base.Initialize(provider); } protected internal override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext) { return SequenceHelper.Execute(this, executionContext); } protected internal override ActivityExecutionStatus Cancel(ActivityExecutionContext executionContext) { return SequenceHelper.Cancel(this, executionContext); } void IActivityEventListener .OnEvent(Object sender, ActivityExecutionStatusChangedEventArgs e) { SequenceHelper.OnEvent(this, sender, e); } protected internal override void OnActivityChangeRemove(ActivityExecutionContext executionContext, Activity removedActivity) { SequenceHelper.OnActivityChangeRemove(this, executionContext, removedActivity); } protected internal override void OnWorkflowChangesCompleted(ActivityExecutionContext executionContext) { SequenceHelper.OnWorkflowChangesCompleted(this, executionContext); } } internal sealed class CancellationHandlerValidator : CompositeActivityValidator { public override ValidationErrorCollection Validate(ValidationManager manager, object obj) { ValidationErrorCollection validationErrors = base.Validate(manager, obj); CancellationHandlerActivity cancellationHandlerActivity = obj as CancellationHandlerActivity; if (cancellationHandlerActivity == null) throw new ArgumentException(SR.GetString(SR.Error_UnexpectedArgumentType, typeof(CancellationHandlerActivity).FullName), "obj"); if (cancellationHandlerActivity.EnabledActivities.Count == 0) validationErrors.Add(new ValidationError(SR.GetString(SR.Warning_EmptyBehaviourActivity, typeof(CancellationHandlerActivity).FullName, cancellationHandlerActivity.QualifiedName), ErrorNumbers.Warning_EmptyBehaviourActivity, true)); // cancellation handlers can not contain fault handlers, compensation handler and cancellation handler if (((ISupportAlternateFlow)cancellationHandlerActivity).AlternateFlowActivities.Count > 0) validationErrors.Add(new ValidationError(SR.GetString(SR.Error_ModelingConstructsCanNotContainModelingConstructs), ErrorNumbers.Error_ModelingConstructsCanNotContainModelingConstructs)); return validationErrors; } } } // 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
- EntityStoreSchemaGenerator.cs
- Stylus.cs
- PerformanceCountersElement.cs
- TableLayoutSettingsTypeConverter.cs
- TextBox.cs
- InvokeGenerator.cs
- CreateUserWizardStep.cs
- RealProxy.cs
- MutexSecurity.cs
- IisTraceListener.cs
- SmtpNegotiateAuthenticationModule.cs
- MailAddressCollection.cs
- ApplyImportsAction.cs
- ReferenceTypeElement.cs
- HtmlToClrEventProxy.cs
- SafeSecurityHandles.cs
- dtdvalidator.cs
- MILUtilities.cs
- TreeView.cs
- CollectionViewProxy.cs
- NTAccount.cs
- RichTextBox.cs
- PenThreadWorker.cs
- XsdBuilder.cs
- Pair.cs
- SizeConverter.cs
- ObjectHandle.cs
- EntityDataSourceState.cs
- WrapPanel.cs
- XsdValidatingReader.cs
- BrushValueSerializer.cs
- IssuanceLicense.cs
- WmlPageAdapter.cs
- SqlAliasesReferenced.cs
- DropDownList.cs
- WindowProviderWrapper.cs
- ServiceDescriptionReflector.cs
- DataGridViewRowsRemovedEventArgs.cs
- SystemException.cs
- COM2EnumConverter.cs
- PermissionListSet.cs
- ImageMapEventArgs.cs
- HtmlFormWrapper.cs
- FormatException.cs
- Expr.cs
- ToolStripContainerDesigner.cs
- PresentationSource.cs
- serverconfig.cs
- TimelineCollection.cs
- LogArchiveSnapshot.cs
- SmtpAuthenticationManager.cs
- Action.cs
- CellParaClient.cs
- FieldDescriptor.cs
- PropertyChangedEventArgs.cs
- HandledMouseEvent.cs
- MonitorWrapper.cs
- CheckBoxField.cs
- AncestorChangedEventArgs.cs
- XmlSerializer.cs
- ConnectionManagementElement.cs
- SoapSchemaMember.cs
- MD5.cs
- DataExpression.cs
- DbConnectionPoolOptions.cs
- AutomationPropertyInfo.cs
- CancelAsyncOperationRequest.cs
- ColorMatrix.cs
- IndicCharClassifier.cs
- XmlText.cs
- Ops.cs
- AssemblyAttributesGoHere.cs
- ApplicationServicesHostFactory.cs
- DBBindings.cs
- RuntimeEnvironment.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- ClientRuntimeConfig.cs
- KeyValuePairs.cs
- Win32Native.cs
- baseaxisquery.cs
- SortExpressionBuilder.cs
- ConfigurationFileMap.cs
- UnsafeNativeMethodsPenimc.cs
- FileDialog.cs
- RegistryPermission.cs
- DataListItem.cs
- XmlSchemaValidationException.cs
- SqlParameterCollection.cs
- OptimisticConcurrencyException.cs
- ConstNode.cs
- PropertyPathConverter.cs
- ResourceProviderFactory.cs
- DataGridViewRowPrePaintEventArgs.cs
- RayMeshGeometry3DHitTestResult.cs
- DataGridColumnCollection.cs
- cookiecontainer.cs
- BitmapCodecInfoInternal.cs
- SimpleLine.cs
- AppModelKnownContentFactory.cs
- SQLDecimal.cs