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
- ButtonFieldBase.cs
- BaseUriHelper.cs
- XmlCustomFormatter.cs
- XmlSerializerVersionAttribute.cs
- TraceProvider.cs
- SynchronizedInputPattern.cs
- DataChangedEventManager.cs
- DEREncoding.cs
- IResourceProvider.cs
- ProcessModuleDesigner.cs
- Polygon.cs
- Stackframe.cs
- BamlLocalizationDictionary.cs
- ConnectorSelectionGlyph.cs
- HyperLink.cs
- OdbcTransaction.cs
- HwndTarget.cs
- NativeMethods.cs
- KeyFrames.cs
- MsmqIntegrationOutputChannel.cs
- X509ImageLogo.cs
- DbFunctionCommandTree.cs
- IssuedSecurityTokenProvider.cs
- XmlWhitespace.cs
- TextViewSelectionProcessor.cs
- CustomCategoryAttribute.cs
- RijndaelCryptoServiceProvider.cs
- XmlRootAttribute.cs
- ToolboxItemCollection.cs
- HostProtectionPermission.cs
- ValidationHelper.cs
- EndpointConfigContainer.cs
- DbgCompiler.cs
- NetWebProxyFinder.cs
- ReadOnlyDataSource.cs
- GridViewDeleteEventArgs.cs
- AsyncContentLoadedEventArgs.cs
- InternalConfigConfigurationFactory.cs
- FixedFlowMap.cs
- WebPartChrome.cs
- PropertyGridDesigner.cs
- RTTypeWrapper.cs
- CookielessHelper.cs
- HttpRequest.cs
- XmlAutoDetectWriter.cs
- MissingMethodException.cs
- PerformanceCounterLib.cs
- codemethodreferenceexpression.cs
- PropertyValueUIItem.cs
- LinkArea.cs
- ListItemConverter.cs
- UICuesEvent.cs
- TextTreeObjectNode.cs
- SqlUtils.cs
- OneOfElement.cs
- EditBehavior.cs
- Page.cs
- PropertyTabChangedEvent.cs
- DBConcurrencyException.cs
- Stacktrace.cs
- TrackingMemoryStream.cs
- Int16.cs
- DataGridViewComboBoxCell.cs
- IRCollection.cs
- WorkflowInstance.cs
- LocalValueEnumerator.cs
- SQLDecimal.cs
- ClientSideQueueItem.cs
- SourceSwitch.cs
- TagElement.cs
- BooleanProjectedSlot.cs
- StandardCommands.cs
- XmlWriterSettings.cs
- AffineTransform3D.cs
- DateTimeSerializationSection.cs
- TdsParameterSetter.cs
- TransformGroup.cs
- AspProxy.cs
- DataContractJsonSerializerOperationFormatter.cs
- XmlSchemaRedefine.cs
- ObjectDataSourceDisposingEventArgs.cs
- RelationalExpressions.cs
- CustomCategoryAttribute.cs
- SByteStorage.cs
- HttpListenerPrefixCollection.cs
- CodeIndexerExpression.cs
- LoginView.cs
- MaterialGroup.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- AlternateViewCollection.cs
- ArrayList.cs
- SafeNativeMethodsCLR.cs
- mediaeventargs.cs
- ToolStripOverflowButton.cs
- StyleModeStack.cs
- TextModifier.cs
- PropertyMapper.cs
- DbConnectionClosed.cs
- IBuiltInEvidence.cs
- ToolBarDesigner.cs