Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Compiler / Validation / ActivityValidator.cs / 1305376 / ActivityValidator.cs
namespace System.Workflow.ComponentModel.Compiler { using System; using System.Reflection; using System.Workflow.ComponentModel.Design; #region Class ActivityValidator public class ActivityValidator : DependencyObjectValidator { public override ValidationErrorCollection Validate(ValidationManager manager, object obj) { if (manager == null) throw new ArgumentNullException("manager"); Activity activity = obj as Activity; if (activity == null) throw new ArgumentException(SR.GetString(SR.Error_UnexpectedArgumentType, typeof(Activity).FullName), "obj"); if (manager.Context == null) throw new ArgumentException("manager", SR.GetString(SR.Error_MissingContextProperty)); manager.Context.Push(activity); ValidationErrorCollection errors = new ValidationErrorCollection(); errors.AddRange(base.Validate(manager, obj)); if (activity.Parent == null) { errors.AddRange(ValidationHelpers.ValidateUniqueIdentifiers(activity)); if (activity.Enabled == false) { ValidationError error = new ValidationError(SR.GetString(SR.Error_RootIsNotEnabled), ErrorNumbers.Error_RootIsNotEnabled); error.PropertyName = "Enabled"; errors.Add(error); } } // validate ID property, only if it is not root activity Activity rootActivity = Helpers.GetRootActivity(activity); if (activity != rootActivity) { ValidationError identifierError = ValidationHelpers.ValidateNameProperty("Name", manager, activity.Name); if (identifierError != null) errors.Add(identifierError); } try { errors.AddRange(ValidateProperties(manager, obj)); } finally { System.Diagnostics.Debug.Assert(manager.Context.Current == activity, "Unwinding contextStack: the item that is about to be popped is not the one we pushed."); manager.Context.Pop(); } return errors; } } #endregion } // 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
- LayoutTable.cs
- DictionarySectionHandler.cs
- AutomationProperty.cs
- ProgressChangedEventArgs.cs
- RawUIStateInputReport.cs
- ConnectorEditor.cs
- XmlQueryContext.cs
- RequestContextBase.cs
- RequiredAttributeAttribute.cs
- GlobalItem.cs
- SerialStream.cs
- XmlByteStreamReader.cs
- ApplicationException.cs
- EntityViewGenerationConstants.cs
- CurrentChangingEventArgs.cs
- DocumentScope.cs
- List.cs
- TypeConverterValueSerializer.cs
- DynamicDataExtensions.cs
- ServiceObjectContainer.cs
- SqlDataSourceSelectingEventArgs.cs
- XmlEncoding.cs
- ThrowHelper.cs
- XmlAttributeAttribute.cs
- cookiecontainer.cs
- TemplateControlParser.cs
- GridLength.cs
- XPathParser.cs
- ReservationCollection.cs
- LifetimeManager.cs
- BigInt.cs
- DocumentPageViewAutomationPeer.cs
- ECDsaCng.cs
- XmlRawWriter.cs
- PassportIdentity.cs
- CardSpaceShim.cs
- XmlNode.cs
- LogConverter.cs
- ConfigPathUtility.cs
- Win32Exception.cs
- HTMLTagNameToTypeMapper.cs
- ByteConverter.cs
- MimeObjectFactory.cs
- ActivityBuilderHelper.cs
- Ray3DHitTestResult.cs
- RequestCacheManager.cs
- ServicePoint.cs
- FileLoadException.cs
- DataControlField.cs
- CategoryAttribute.cs
- wgx_exports.cs
- EventlogProvider.cs
- ExtendedProtectionPolicy.cs
- Calendar.cs
- ConfigurationException.cs
- XmlSerializationGeneratedCode.cs
- AxHostDesigner.cs
- ValidatingReaderNodeData.cs
- DefaultMemberAttribute.cs
- AttributeCallbackBuilder.cs
- TextFormatter.cs
- SimpleParser.cs
- NotifyIcon.cs
- ErrorTableItemStyle.cs
- DataPagerField.cs
- ConnectionPointGlyph.cs
- AssemblyNameUtility.cs
- ServiceErrorHandler.cs
- NetTcpSecurityElement.cs
- WebHeaderCollection.cs
- SequentialUshortCollection.cs
- CommandPlan.cs
- VariableQuery.cs
- DtrList.cs
- LayoutEditorPart.cs
- Line.cs
- SignerInfo.cs
- GeneralTransform3DGroup.cs
- SignatureDescription.cs
- EncodedStreamFactory.cs
- SrgsToken.cs
- EncryptedPackage.cs
- ParagraphResult.cs
- KnowledgeBase.cs
- ExpressionParser.cs
- LiteralDesigner.cs
- MenuEventArgs.cs
- ExpressionConverter.cs
- XPathSelectionIterator.cs
- MaterializeFromAtom.cs
- ToolStripTextBox.cs
- WebControl.cs
- CompositionTarget.cs
- CodeLabeledStatement.cs
- HTTPNotFoundHandler.cs
- MULTI_QI.cs
- ExpressionNormalizer.cs
- PartialArray.cs
- CompositeScriptReference.cs
- IncrementalReadDecoders.cs