Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / ErrorsHelper.cs / 1305376 / ErrorsHelper.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Configuration { using System.Collections; using System.Collections.Specialized; using System.Collections.Generic; static internal class ErrorsHelper { static internal int GetErrorCount(Listerrors) { return (errors != null) ? errors.Count : 0; } static internal bool GetHasErrors(List errors) { return GetErrorCount(errors) > 0; } static internal void AddError(ref List errors, ConfigurationException e) { Debug.Assert(e != null, "e != null"); // Create on demand if (errors == null) { errors = new List (); } ConfigurationErrorsException ce = e as ConfigurationErrorsException; if (ce == null) { errors.Add(e); } else { ICollection col = ce.ErrorsGeneric; if (col.Count == 1) { errors.Add(e); } else { errors.AddRange(col); } } } static internal void AddErrors(ref List errors, ICollection coll) { if (coll == null || coll.Count == 0) { // Nothing to do here, bail return; } foreach (ConfigurationException e in coll) { AddError(ref errors, e); } } static internal ConfigurationErrorsException GetErrorsException(List errors) { if (errors == null) { return null; } Debug.Assert(errors.Count != 0, "errors.Count != 0"); return new ConfigurationErrorsException(errors); } static internal void ThrowOnErrors(List errors) { ConfigurationErrorsException e = GetErrorsException(errors); if (e != null) { throw e; } } } } // 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
- HtmlFormWrapper.cs
- WeakReference.cs
- ChineseLunisolarCalendar.cs
- GorillaCodec.cs
- InputBinding.cs
- ObjectQuery.cs
- FileStream.cs
- DocumentViewer.cs
- InvokeMethod.cs
- DataGridViewHitTestInfo.cs
- ConfigurationManagerInternalFactory.cs
- MultiBindingExpression.cs
- SimpleHandlerBuildProvider.cs
- Errors.cs
- BindingListCollectionView.cs
- Aggregates.cs
- sqlmetadatafactory.cs
- ASCIIEncoding.cs
- TextEndOfSegment.cs
- DoubleCollection.cs
- CodeTypeParameter.cs
- TemplateBindingExtensionConverter.cs
- DataGridItemAutomationPeer.cs
- SqlEnums.cs
- SvcMapFileSerializer.cs
- StateMachineHelpers.cs
- ColumnResult.cs
- Delegate.cs
- StyleSheetRefUrlEditor.cs
- DescendantOverDescendantQuery.cs
- DivideByZeroException.cs
- CodeEventReferenceExpression.cs
- shaperfactoryquerycachekey.cs
- LogSwitch.cs
- CachedPathData.cs
- CommentAction.cs
- SynchronizedInputProviderWrapper.cs
- RectangleGeometry.cs
- MenuItemStyleCollection.cs
- MetadataItem_Static.cs
- ProcessModelSection.cs
- ExtendedPropertyCollection.cs
- ServiceInfo.cs
- RequestNavigateEventArgs.cs
- HexParser.cs
- DependencyPropertyHelper.cs
- SimpleMailWebEventProvider.cs
- MimeWriter.cs
- CacheDependency.cs
- LayoutTable.cs
- AnimatedTypeHelpers.cs
- DocumentStream.cs
- DataPagerFieldItem.cs
- XamlGridLengthSerializer.cs
- AttachedAnnotationChangedEventArgs.cs
- VersionedStream.cs
- Send.cs
- StreamUpdate.cs
- RestHandlerFactory.cs
- PeerObject.cs
- RequestSecurityTokenResponseCollection.cs
- SyndicationItemFormatter.cs
- ArrayMergeHelper.cs
- PrinterUnitConvert.cs
- DesignerDataView.cs
- ServiceElementCollection.cs
- DataGridViewCellCollection.cs
- FileReservationCollection.cs
- SettingsBase.cs
- TaskFormBase.cs
- Repeater.cs
- ArcSegment.cs
- TypeSource.cs
- HttpPostProtocolReflector.cs
- DataErrorValidationRule.cs
- ToolStripRendererSwitcher.cs
- Vector3DCollectionValueSerializer.cs
- RewritingProcessor.cs
- rsa.cs
- StorageInfo.cs
- ToolStripSeparatorRenderEventArgs.cs
- ReferenceEqualityComparer.cs
- HandlerFactoryCache.cs
- CookielessData.cs
- Vector.cs
- SyndicationDeserializer.cs
- ChineseLunisolarCalendar.cs
- EdgeProfileValidation.cs
- Int32Collection.cs
- SettingsProviderCollection.cs
- XmlnsDictionary.cs
- TdsParserHelperClasses.cs
- SendDesigner.xaml.cs
- JpegBitmapEncoder.cs
- TypeUnloadedException.cs
- AssemblyInfo.cs
- CapiHashAlgorithm.cs
- HtmlSelect.cs
- SqlDependencyListener.cs
- WebPartActionVerb.cs