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
- ImageField.cs
- SEHException.cs
- ShaderEffect.cs
- OleDbConnectionFactory.cs
- BaseDataList.cs
- MimeMultiPart.cs
- IPAddress.cs
- SafeCryptContextHandle.cs
- PackWebRequestFactory.cs
- coordinator.cs
- ArcSegment.cs
- TableStyle.cs
- RegexWorker.cs
- EventDescriptor.cs
- PersonalizationProviderCollection.cs
- ComPlusContractBehavior.cs
- UserControlBuildProvider.cs
- Pool.cs
- RecognizedWordUnit.cs
- XmlNotation.cs
- QuotedPrintableStream.cs
- WebPartTransformerAttribute.cs
- LinearKeyFrames.cs
- Function.cs
- RegistrySecurity.cs
- RangeValuePattern.cs
- RuntimeResourceSet.cs
- InspectionWorker.cs
- xml.cs
- ConcurrencyBehavior.cs
- ParagraphResult.cs
- XmlTextReader.cs
- FormatterConverter.cs
- TrackBarRenderer.cs
- StdValidatorsAndConverters.cs
- HttpPostedFileWrapper.cs
- IDictionary.cs
- ContentControl.cs
- StreamAsIStream.cs
- RepeatBehavior.cs
- LoginDesignerUtil.cs
- SoapAttributes.cs
- DataGridPageChangedEventArgs.cs
- RelatedView.cs
- WebBrowserProgressChangedEventHandler.cs
- UIElement.cs
- UriSection.cs
- BindingRestrictions.cs
- DiscoveryClientDuplexChannel.cs
- ContractTypeNameElement.cs
- MailBnfHelper.cs
- TextSelection.cs
- CompiledRegexRunnerFactory.cs
- XmlHierarchicalDataSourceView.cs
- SecuritySessionServerSettings.cs
- loginstatus.cs
- FillErrorEventArgs.cs
- DesignTimeData.cs
- SoapMessage.cs
- StrongNameHelpers.cs
- UnionExpr.cs
- LassoHelper.cs
- EntityReference.cs
- MultiTargetingUtil.cs
- Int32CollectionConverter.cs
- NamespaceEmitter.cs
- GeneralTransform.cs
- SpnEndpointIdentityExtension.cs
- AddInIpcChannel.cs
- HtmlInputCheckBox.cs
- Logging.cs
- GridViewSelectEventArgs.cs
- TraceUtility.cs
- DBCommandBuilder.cs
- GuidTagList.cs
- Knowncolors.cs
- BridgeDataReader.cs
- ComboBoxRenderer.cs
- FormViewPagerRow.cs
- XmlSubtreeReader.cs
- MultiPageTextView.cs
- ComponentEditorPage.cs
- ModelService.cs
- BuildProvidersCompiler.cs
- MenuItem.cs
- CheckableControlBaseAdapter.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- WeakReferenceKey.cs
- SafeThreadHandle.cs
- DiscoveryDocumentSearchPattern.cs
- GridSplitterAutomationPeer.cs
- shaperfactoryquerycacheentry.cs
- XmlSchemas.cs
- ComContractElementCollection.cs
- Models.cs
- MemberHolder.cs
- PreviewKeyDownEventArgs.cs
- HelpEvent.cs
- ServicesExceptionNotHandledEventArgs.cs
- WSMessageEncoding.cs