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
- ExpressionEditorAttribute.cs
- XmlAttributeAttribute.cs
- EncoderNLS.cs
- DataGridCellsPanel.cs
- SelectionRange.cs
- WebPartRestoreVerb.cs
- FixUp.cs
- CompleteWizardStep.cs
- Point3D.cs
- WebPartsPersonalizationAuthorization.cs
- SqlConnectionPoolProviderInfo.cs
- StyleHelper.cs
- Aggregates.cs
- SiteMapNode.cs
- FlowDocumentPage.cs
- SectionXmlInfo.cs
- ComboBoxRenderer.cs
- WebEventTraceProvider.cs
- XLinq.cs
- DnsPermission.cs
- Permission.cs
- PtsCache.cs
- Util.cs
- SqlFacetAttribute.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- XPathNavigatorKeyComparer.cs
- FamilyCollection.cs
- PackagePartCollection.cs
- InertiaExpansionBehavior.cs
- BinaryEditor.cs
- HttpRequestCacheValidator.cs
- ConfigXmlComment.cs
- SelectedDatesCollection.cs
- GroupLabel.cs
- EventLogEntryCollection.cs
- RtfToXamlLexer.cs
- AtomPub10ServiceDocumentFormatter.cs
- XmlSchemaSet.cs
- ContentDisposition.cs
- WindowsListView.cs
- ClientUtils.cs
- SqlLiftWhereClauses.cs
- SecureConversationVersion.cs
- ObservableDictionary.cs
- CookieProtection.cs
- XslVisitor.cs
- ExtendedPropertyCollection.cs
- DataColumnMapping.cs
- XmlDataSourceView.cs
- InsufficientMemoryException.cs
- CurrentTimeZone.cs
- ReversePositionQuery.cs
- Frame.cs
- ModelTreeManager.cs
- UnsafeNativeMethods.cs
- Int32Collection.cs
- StringBuilder.cs
- PropertyMetadata.cs
- Pen.cs
- KnownTypesHelper.cs
- odbcmetadatafactory.cs
- IdnElement.cs
- ToolStripDropDownClosingEventArgs.cs
- COMException.cs
- MemberHolder.cs
- PerformanceCountersElement.cs
- CodeDirectoryCompiler.cs
- RecordsAffectedEventArgs.cs
- TcpProcessProtocolHandler.cs
- DecoratedNameAttribute.cs
- ConfigXmlCDataSection.cs
- MembershipSection.cs
- TraceEventCache.cs
- CalendarTable.cs
- MachineKey.cs
- DoubleLinkList.cs
- PeerNameRecord.cs
- ModuleBuilderData.cs
- RowType.cs
- ProfilePropertySettings.cs
- WebServiceParameterData.cs
- BaseAsyncResult.cs
- PersonalizationDictionary.cs
- AddDataControlFieldDialog.cs
- ObsoleteAttribute.cs
- XPathNodeList.cs
- FrameDimension.cs
- PrintPreviewDialog.cs
- WorkflowDefinitionContext.cs
- MethodCallConverter.cs
- HtmlTextBoxAdapter.cs
- CodeTypeDelegate.cs
- WebPartTransformerCollection.cs
- ManagedFilter.cs
- _SafeNetHandles.cs
- GeometryModel3D.cs
- SQLInt32.cs
- OleDbConnection.cs
- CryptoKeySecurity.cs
- ListViewDataItem.cs