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
- DataGridTextBox.cs
- HostUtils.cs
- DataGridViewTopRowAccessibleObject.cs
- ClientData.cs
- ProcessInputEventArgs.cs
- EventLogSession.cs
- XsdSchemaFileEditor.cs
- DbConnectionStringCommon.cs
- CellRelation.cs
- ContentPlaceHolderDesigner.cs
- DataGridViewCell.cs
- CLRBindingWorker.cs
- Transform3DGroup.cs
- SQLByte.cs
- RequestQueryProcessor.cs
- FontConverter.cs
- Point4D.cs
- Nullable.cs
- ErrorRuntimeConfig.cs
- StringFormat.cs
- SafeRightsManagementPubHandle.cs
- CompositeCollection.cs
- GetParentChain.cs
- DataKeyCollection.cs
- StagingAreaInputItem.cs
- PopupControlService.cs
- RtfControls.cs
- GZipStream.cs
- _NegotiateClient.cs
- StringWriter.cs
- AttachedAnnotation.cs
- EmissiveMaterial.cs
- ServiceControllerDesigner.cs
- ActivityMarkupSerializer.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- SdlChannelSink.cs
- SessionMode.cs
- PropertyTabChangedEvent.cs
- DependentList.cs
- ListViewItemSelectionChangedEvent.cs
- _CacheStreams.cs
- Part.cs
- AdvancedBindingEditor.cs
- UrlRoutingModule.cs
- FixedSOMFixedBlock.cs
- ProfileManager.cs
- IndexedString.cs
- TypographyProperties.cs
- PolicyUnit.cs
- StorageMappingFragment.cs
- PerformanceCounterCategory.cs
- SymLanguageType.cs
- SqlBuffer.cs
- ping.cs
- ComponentDispatcherThread.cs
- DoubleAnimationUsingKeyFrames.cs
- TransformGroup.cs
- QueryExpr.cs
- Timeline.cs
- BooleanFunctions.cs
- Range.cs
- HttpStreams.cs
- SettingsPropertyNotFoundException.cs
- TypeToArgumentTypeConverter.cs
- EntityUtil.cs
- XamlFilter.cs
- ToolStripScrollButton.cs
- HttpAsyncResult.cs
- DesignerActionItemCollection.cs
- ToolboxControl.cs
- fixedPageContentExtractor.cs
- RuntimeEnvironment.cs
- HierarchicalDataBoundControlAdapter.cs
- XPathNavigatorReader.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- DecimalAnimationBase.cs
- ThreadExceptionEvent.cs
- ErrorLog.cs
- Imaging.cs
- DynamicQueryStringParameter.cs
- ScriptBehaviorDescriptor.cs
- BamlResourceContent.cs
- EditingMode.cs
- BooleanFunctions.cs
- ButtonFlatAdapter.cs
- XmlResolver.cs
- CollectionsUtil.cs
- UInt64.cs
- Events.cs
- oledbmetadatacollectionnames.cs
- _BufferOffsetSize.cs
- FieldBuilder.cs
- InputLangChangeRequestEvent.cs
- FrameworkObject.cs
- PeerHelpers.cs
- InvalidateEvent.cs
- ObjectViewEntityCollectionData.cs
- WebControl.cs
- ProviderConnectionPoint.cs
- PolicyValidationException.cs