Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Configuration / System / Configuration / ErrorsHelper.cs / 1 / 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. //------------------------------------------------------------------------------ // // 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
- WebBrowserDocumentCompletedEventHandler.cs
- SqlCommand.cs
- SmiRecordBuffer.cs
- ProcessHostFactoryHelper.cs
- XmlValidatingReaderImpl.cs
- OuterGlowBitmapEffect.cs
- DNS.cs
- __Filters.cs
- WindowsFormsHelpers.cs
- TextTreeTextBlock.cs
- HttpWebResponse.cs
- XmlNamespaceManager.cs
- DataSourceConverter.cs
- HMACSHA384.cs
- StringConverter.cs
- MdiWindowListItemConverter.cs
- ExpressionTextBoxAutomationPeer.cs
- counter.cs
- TriState.cs
- XPathAncestorQuery.cs
- PageWrapper.cs
- TemplatedMailWebEventProvider.cs
- DataServiceResponse.cs
- ChtmlSelectionListAdapter.cs
- CheckBoxDesigner.cs
- FileClassifier.cs
- Vars.cs
- xmlfixedPageInfo.cs
- EntityRecordInfo.cs
- Cursor.cs
- BindingExpressionBase.cs
- TextServicesCompartmentContext.cs
- EventProperty.cs
- Track.cs
- XmlSerializerVersionAttribute.cs
- WebPartAuthorizationEventArgs.cs
- Byte.cs
- DataSourceConverter.cs
- ACE.cs
- ExtensionSurface.cs
- CodeAttributeArgument.cs
- BitmapMetadataEnumerator.cs
- TransformerInfoCollection.cs
- X509RawDataKeyIdentifierClause.cs
- DataGridViewSortCompareEventArgs.cs
- ConstructorBuilder.cs
- ImageIndexConverter.cs
- AnimatedTypeHelpers.cs
- RegionIterator.cs
- TimeoutHelper.cs
- X500Name.cs
- CustomErrorsSection.cs
- WebBrowserEvent.cs
- EmptyStringExpandableObjectConverter.cs
- DirectoryRedirect.cs
- HtmlLabelAdapter.cs
- SpecialFolderEnumConverter.cs
- TimersDescriptionAttribute.cs
- HTTPNotFoundHandler.cs
- FileNameEditor.cs
- SerializationHelper.cs
- SrgsDocument.cs
- CharEntityEncoderFallback.cs
- SR.cs
- EntityKey.cs
- GenericWebPart.cs
- ViewBox.cs
- DesignerDataTable.cs
- MultiPropertyDescriptorGridEntry.cs
- WindowsListViewGroupSubsetLink.cs
- DataListItem.cs
- Html32TextWriter.cs
- __ComObject.cs
- Floater.cs
- ServicePointManagerElement.cs
- RequestSecurityTokenResponse.cs
- ClientApiGenerator.cs
- VariantWrapper.cs
- XPathArrayIterator.cs
- XNameTypeConverter.cs
- ModelChangedEventArgsImpl.cs
- ContainerUtilities.cs
- CapiHashAlgorithm.cs
- DbConnectionPool.cs
- WpfKnownMemberInvoker.cs
- SemaphoreFullException.cs
- MimeMapping.cs
- XmlEnumAttribute.cs
- ListView.cs
- AdCreatedEventArgs.cs
- SupportsEventValidationAttribute.cs
- XmlQueryCardinality.cs
- cookiecollection.cs
- SplitterPanel.cs
- CodeAccessPermission.cs
- ImageConverter.cs
- Code.cs
- DefaultDiscoveryService.cs
- SQLString.cs
- DataServices.cs