Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Activities / StateFinalizationActivity.cs / 1305376 / StateFinalizationActivity.cs
namespace System.Workflow.Activities { #region Imports using System; using System.Text; using System.Reflection; using System.Collections; using System.Collections.Generic; using System.CodeDom; using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using System.Workflow.ComponentModel; using System.Workflow.ComponentModel.Design; using System.Workflow.ComponentModel.Compiler; using System.Workflow.Activities.Common; #endregion [SRDescription(SR.StateFinalizationActivityDescription)] [Designer(typeof(StateFinalizationDesigner), typeof(IDesigner))] [ToolboxItem(typeof(ActivityToolboxItem))] [ToolboxBitmap(typeof(StateFinalizationActivity), "Resources.StateFinalizationActivity.png")] [ActivityValidator(typeof(StateFinalizationValidator))] [SRCategory(SR.Standard)] [System.Runtime.InteropServices.ComVisible(false)] public sealed class StateFinalizationActivity : SequenceActivity { public StateFinalizationActivity() { } public StateFinalizationActivity(string name) :base(name) { } } [System.Runtime.InteropServices.ComVisible(false)] internal sealed class StateFinalizationValidator : CompositeActivityValidator { public override ValidationErrorCollection Validate(ValidationManager manager, object obj) { ValidationErrorCollection validationErrors = base.Validate(manager, obj); StateFinalizationActivity stateFinalization = obj as StateFinalizationActivity; if (stateFinalization == null) throw new ArgumentException(SR.GetString(SR.Error_UnexpectedArgumentType, typeof(StateFinalizationActivity).FullName), "obj"); StateActivity state = stateFinalization.Parent as StateActivity; if (state == null) { validationErrors.Add(new ValidationError(SR.GetError_StateFinalizationParentNotState(), ErrorNumbers.Error_StateHandlerParentNotState)); return validationErrors; } foreach (Activity activity in state.EnabledActivities) { StateFinalizationActivity childStateFinalization = activity as StateFinalizationActivity; if (childStateFinalization != null) { if (childStateFinalization == stateFinalization) continue; validationErrors.Add(new ValidationError( SR.GetError_MultipleStateFinalizationActivities(), ErrorNumbers.Error_MultipleStateFinalizationActivities)); break; } } if (StateMachineHelpers.ContainsEventActivity(stateFinalization)) { validationErrors.Add(new ValidationError(SR.GetError_EventActivityNotValidInStateFinalization(), ErrorNumbers.Error_EventActivityNotValidInStateHandler)); } 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
- BrowserCapabilitiesCodeGenerator.cs
- PasswordRecovery.cs
- Directory.cs
- RunWorkerCompletedEventArgs.cs
- PropertyRef.cs
- RegionData.cs
- DocComment.cs
- QilTernary.cs
- XamlHttpHandlerFactory.cs
- WebControlToolBoxItem.cs
- SqlUtil.cs
- DynamicFilter.cs
- MemberAccessException.cs
- PathFigure.cs
- ZipIOModeEnforcingStream.cs
- ChannelServices.cs
- FixedPageStructure.cs
- LineUtil.cs
- ClaimTypeElementCollection.cs
- ProfilePropertyNameValidator.cs
- ResourceReferenceKeyNotFoundException.cs
- NTAccount.cs
- Types.cs
- NetworkInformationException.cs
- __ConsoleStream.cs
- PropertyNames.cs
- _HelperAsyncResults.cs
- BamlResourceContent.cs
- VisualBrush.cs
- DbQueryCommandTree.cs
- RadialGradientBrush.cs
- CurrentChangingEventArgs.cs
- BamlRecordWriter.cs
- WindowInteractionStateTracker.cs
- TransactionFlowBindingElementImporter.cs
- ExpressionsCollectionEditor.cs
- CheckPair.cs
- UnknownExceptionActionHelper.cs
- EmptyEnumerable.cs
- PenThread.cs
- QueryContinueDragEventArgs.cs
- TerminatorSinks.cs
- ObjectNotFoundException.cs
- ManifestBasedResourceGroveler.cs
- BaseCodeDomTreeGenerator.cs
- QilScopedVisitor.cs
- ImmutableObjectAttribute.cs
- AffineTransform3D.cs
- securestring.cs
- ControlAdapter.cs
- CalculatedColumn.cs
- SpecularMaterial.cs
- assemblycache.cs
- XPathNodeIterator.cs
- SmiEventSink_Default.cs
- DesignerTransaction.cs
- Rijndael.cs
- DynamicDocumentPaginator.cs
- RightsManagementPermission.cs
- SapiInterop.cs
- TableLayoutRowStyleCollection.cs
- DataPagerFieldCommandEventArgs.cs
- Clipboard.cs
- ColorBlend.cs
- Sql8ConformanceChecker.cs
- IpcServerChannel.cs
- GACIdentityPermission.cs
- FixedFindEngine.cs
- ZipIOExtraFieldPaddingElement.cs
- securitycriticaldataClass.cs
- InputElement.cs
- MarkupCompilePass2.cs
- AuthorizationSection.cs
- Selector.cs
- DefaultValueAttribute.cs
- ToolStripSplitStackLayout.cs
- CrossContextChannel.cs
- PersonalizableTypeEntry.cs
- DataSourceDescriptorCollection.cs
- ScriptServiceAttribute.cs
- BuildTopDownAttribute.cs
- SafeViewOfFileHandle.cs
- UpdatePanel.cs
- SecurityUtils.cs
- DataViewListener.cs
- GridViewRow.cs
- TargetControlTypeAttribute.cs
- ToolStripItemDesigner.cs
- WebReferenceCollection.cs
- CodeIdentifier.cs
- DoubleAnimationUsingPath.cs
- Type.cs
- SafeHandles.cs
- ControlDesigner.cs
- RichTextBox.cs
- SerializationEventsCache.cs
- _DisconnectOverlappedAsyncResult.cs
- FixedBufferAttribute.cs
- PathFigure.cs
- ObjectTag.cs