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
- SamlSerializer.cs
- BitmapEncoder.cs
- ColorConverter.cs
- NamespaceList.cs
- DoubleLinkListEnumerator.cs
- DataTableCollection.cs
- VisualTarget.cs
- CompilerInfo.cs
- CompoundFileDeflateTransform.cs
- ActivationArguments.cs
- _Events.cs
- XamlTreeBuilder.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- followingquery.cs
- Compiler.cs
- PkcsMisc.cs
- SafeLibraryHandle.cs
- WindowsListBox.cs
- TransformerInfo.cs
- X509RecipientCertificateClientElement.cs
- ObsoleteAttribute.cs
- PhysicalAddress.cs
- DataKeyArray.cs
- TransferRequestHandler.cs
- ConfigXmlCDataSection.cs
- DataList.cs
- KeyValuePairs.cs
- PropertyFilterAttribute.cs
- IdleTimeoutMonitor.cs
- DictionaryBase.cs
- GeometryGroup.cs
- ValidateNames.cs
- UdpSocket.cs
- SignedXmlDebugLog.cs
- CodeAttributeDeclarationCollection.cs
- GenericUI.cs
- AddInServer.cs
- XmlSchemaSimpleContent.cs
- MessageFilterException.cs
- _NegoState.cs
- LongValidatorAttribute.cs
- HttpRequestCacheValidator.cs
- DataBinder.cs
- Thumb.cs
- OneOfScalarConst.cs
- ControlCachePolicy.cs
- TraceHandlerErrorFormatter.cs
- ComponentManagerBroker.cs
- AlgoModule.cs
- RSAPKCS1SignatureDeformatter.cs
- MulticastIPAddressInformationCollection.cs
- ActivityTypeCodeDomSerializer.cs
- DataGridViewCellCollection.cs
- PerformanceCounterPermission.cs
- ContractReference.cs
- LinqDataSourceInsertEventArgs.cs
- WebPartZoneCollection.cs
- SubstitutionResponseElement.cs
- TimeEnumHelper.cs
- CompilerInfo.cs
- BitmapData.cs
- OdbcUtils.cs
- XmlSchemaInfo.cs
- DataColumnMappingCollection.cs
- SystemColorTracker.cs
- JoinCqlBlock.cs
- GlyphInfoList.cs
- XmlExceptionHelper.cs
- DbProviderManifest.cs
- OutputScopeManager.cs
- EntityContainerAssociationSetEnd.cs
- translator.cs
- BitmapImage.cs
- VectorAnimationUsingKeyFrames.cs
- XmlTextAttribute.cs
- CheckBoxBaseAdapter.cs
- ComponentCache.cs
- EntityParameter.cs
- RecipientInfo.cs
- RequestUriProcessor.cs
- ListViewHitTestInfo.cs
- TextAnchor.cs
- FontEmbeddingManager.cs
- RegexFCD.cs
- metadatamappinghashervisitor.cs
- InheritedPropertyChangedEventArgs.cs
- SimpleType.cs
- SqlDataSourceDesigner.cs
- XmlEventCache.cs
- RelationshipEnd.cs
- DataSourceCacheDurationConverter.cs
- Table.cs
- AdPostCacheSubstitution.cs
- ComponentConverter.cs
- ToolStripDropDownItem.cs
- WebControl.cs
- GatewayDefinition.cs
- WindowsMenu.cs
- AlternateViewCollection.cs
- WebHttpBindingElement.cs