Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Validation / ValidationResults.cs / 1305376 / ValidationResults.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Activities.Validation { using System; using System.Collections.ObjectModel; using System.Collections.Generic; using System.Runtime; [Fx.Tag.XamlVisible(false)] public class ValidationResults { ReadOnlyCollectionallValidationErrors; ReadOnlyCollection errors; ReadOnlyCollection warnings; bool processedAllValidationErrors; internal ValidationResults(IList allValidationErrors) { if (allValidationErrors == null) { this.allValidationErrors = ActivityValidationServices.EmptyValidationErrors; } else { this.allValidationErrors = new ReadOnlyCollection (allValidationErrors); } } public ReadOnlyCollection Errors { get { if (!this.processedAllValidationErrors) { ProcessAllValidationErrors(); } return this.errors; } } public ReadOnlyCollection Warnings { get { if (!this.processedAllValidationErrors) { ProcessAllValidationErrors(); } return this.warnings; } } void ProcessAllValidationErrors() { if (this.allValidationErrors.Count == 0) { this.errors = ActivityValidationServices.EmptyValidationErrors; this.warnings = ActivityValidationServices.EmptyValidationErrors; } else { IList warningsList = null; IList errorsList = null; for (int i = 0; i < this.allValidationErrors.Count; i++) { ValidationError violation = this.allValidationErrors[i]; if (violation.IsWarning) { if (warningsList == null) { warningsList = new Collection (); } warningsList.Add(violation); } else { if (errorsList == null) { errorsList = new Collection (); } errorsList.Add(violation); } } if (warningsList == null) { this.warnings = ActivityValidationServices.EmptyValidationErrors; } else { this.warnings = new ReadOnlyCollection (warningsList); } if (errorsList == null) { this.errors = ActivityValidationServices.EmptyValidationErrors; } else { this.errors = new ReadOnlyCollection (errorsList); } } this.processedAllValidationErrors = true; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AddIn.cs
- ConfigurationValue.cs
- CodeComment.cs
- Pens.cs
- ErrorHandlerFaultInfo.cs
- OrderedDictionary.cs
- TrimSurroundingWhitespaceAttribute.cs
- ExtensionFile.cs
- XPathNodeInfoAtom.cs
- FactoryId.cs
- CompilerInfo.cs
- FileSecurity.cs
- ClientSettings.cs
- ImageMetadata.cs
- ImageFormatConverter.cs
- PowerStatus.cs
- EmbeddedMailObject.cs
- ContextConfiguration.cs
- SelectorAutomationPeer.cs
- PrintDialogException.cs
- ContentElementAutomationPeer.cs
- Page.cs
- WinEventWrap.cs
- TokenBasedSetEnumerator.cs
- ToolStripContainer.cs
- SupportingTokenParameters.cs
- WebSysDisplayNameAttribute.cs
- StoreItemCollection.Loader.cs
- PlatformNotSupportedException.cs
- StorageEndPropertyMapping.cs
- Cursor.cs
- NavigationEventArgs.cs
- Token.cs
- FixedDSBuilder.cs
- PolicyValidationException.cs
- ResolveResponseInfo.cs
- VectorConverter.cs
- MarginCollapsingState.cs
- PopupRoot.cs
- DataGridToolTip.cs
- DependencyPropertyKind.cs
- QuaternionAnimationUsingKeyFrames.cs
- MimePart.cs
- FormsAuthenticationEventArgs.cs
- PropertyGridEditorPart.cs
- DataQuery.cs
- XmlSchemaComplexType.cs
- XmlBinaryReader.cs
- StorageTypeMapping.cs
- PropertyMetadata.cs
- ThicknessAnimation.cs
- ModelPerspective.cs
- ToolStripOverflow.cs
- EventLogInternal.cs
- SubMenuStyle.cs
- XhtmlConformanceSection.cs
- FileDialogPermission.cs
- SrgsElementFactory.cs
- DataServiceConfiguration.cs
- DataList.cs
- RijndaelManagedTransform.cs
- SiteMapSection.cs
- ValueUtilsSmi.cs
- SafeEventLogWriteHandle.cs
- WindowsSolidBrush.cs
- WebPartManager.cs
- CustomAttribute.cs
- BrowserCapabilitiesCodeGenerator.cs
- KeyEventArgs.cs
- DeclaredTypeValidatorAttribute.cs
- ConfigurationManagerInternal.cs
- handlecollector.cs
- SafeRightsManagementPubHandle.cs
- Annotation.cs
- MembershipSection.cs
- TranslateTransform3D.cs
- TabControl.cs
- HttpException.cs
- ToolboxComponentsCreatingEventArgs.cs
- SiteMapSection.cs
- MulticastOption.cs
- MessageDescription.cs
- ArgIterator.cs
- OledbConnectionStringbuilder.cs
- DataGridHeaderBorder.cs
- activationcontext.cs
- KeyEventArgs.cs
- Resources.Designer.cs
- WebPartConnectionsConnectVerb.cs
- XslTransform.cs
- SchemaType.cs
- ServiceDebugBehavior.cs
- WSFederationHttpBinding.cs
- TypeExtension.cs
- ACL.cs
- FileAuthorizationModule.cs
- TextInfo.cs
- AppModelKnownContentFactory.cs
- InternalException.cs
- WebPartChrome.cs