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
- ZoomPercentageConverter.cs
- QilName.cs
- ScrollItemPattern.cs
- UITypeEditor.cs
- FontStretch.cs
- Line.cs
- VectorAnimationUsingKeyFrames.cs
- AssemblyCache.cs
- OrderedDictionary.cs
- StackSpiller.cs
- NumericExpr.cs
- ArrayItemValue.cs
- SamlSubjectStatement.cs
- DateTime.cs
- CodeMethodInvokeExpression.cs
- ConstraintCollection.cs
- DecoderExceptionFallback.cs
- ByeMessageCD1.cs
- NetWebProxyFinder.cs
- TextBlock.cs
- RenderCapability.cs
- EncoderExceptionFallback.cs
- RegularExpressionValidator.cs
- ReadOnlyNameValueCollection.cs
- RotateTransform.cs
- HttpCapabilitiesBase.cs
- SamlDelegatingWriter.cs
- IIS7WorkerRequest.cs
- DataGridTableCollection.cs
- DataBinder.cs
- WasEndpointConfigContainer.cs
- RootCodeDomSerializer.cs
- Accessible.cs
- QuestionEventArgs.cs
- ReferenceService.cs
- FamilyMapCollection.cs
- BaseCAMarshaler.cs
- WebDisplayNameAttribute.cs
- ValueQuery.cs
- InitializingNewItemEventArgs.cs
- regiisutil.cs
- View.cs
- PeerReferralPolicy.cs
- SiteMapNodeCollection.cs
- SourceFileBuildProvider.cs
- TimeIntervalCollection.cs
- ApplicationServiceManager.cs
- VectorCollection.cs
- SrgsDocument.cs
- BeginEvent.cs
- ValueType.cs
- PluralizationService.cs
- BitmapEffectGroup.cs
- WebControlAdapter.cs
- ComplexTypeEmitter.cs
- Stylesheet.cs
- XPathNavigator.cs
- SQLDecimal.cs
- SQLMoneyStorage.cs
- CacheDependency.cs
- DifferencingCollection.cs
- ByteConverter.cs
- GradientSpreadMethodValidation.cs
- SystemNetworkInterface.cs
- XamlHttpHandlerFactory.cs
- ChannelManager.cs
- SiteOfOriginContainer.cs
- BamlStream.cs
- LongValidatorAttribute.cs
- HostedTransportConfigurationManager.cs
- TrustLevel.cs
- ClientCultureInfo.cs
- TypeDescriptor.cs
- PropertyRecord.cs
- PolicyValidationException.cs
- GraphicsState.cs
- Line.cs
- LocalFileSettingsProvider.cs
- Pts.cs
- PrintPreviewDialog.cs
- VectorAnimation.cs
- AttachInfo.cs
- WebHttpSecurityElement.cs
- TypeUsage.cs
- XmlFormatExtensionAttribute.cs
- SafeFileMapViewHandle.cs
- InsufficientMemoryException.cs
- PageCodeDomTreeGenerator.cs
- TabItemAutomationPeer.cs
- DescendantOverDescendantQuery.cs
- CacheOutputQuery.cs
- TreeWalker.cs
- UpdatableGenericsFeature.cs
- TypeConverterHelper.cs
- SmiEventSink.cs
- ADMembershipProvider.cs
- CatalogPartCollection.cs
- VisualStyleInformation.cs
- DBConcurrencyException.cs
- StringValidator.cs