Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- MSAANativeProvider.cs
- GetParentChain.cs
- LinearKeyFrames.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- RecognitionResult.cs
- ContextStack.cs
- AxHost.cs
- _NativeSSPI.cs
- TCPListener.cs
- StorageAssociationSetMapping.cs
- KeyGestureConverter.cs
- DecryptRequest.cs
- RepeatBehavior.cs
- MDIControlStrip.cs
- CalendarButton.cs
- StatusBar.cs
- SafeMILHandle.cs
- COM2PropertyDescriptor.cs
- SqlFileStream.cs
- TextDecorationUnitValidation.cs
- Rights.cs
- Nullable.cs
- GlobalItem.cs
- basemetadatamappingvisitor.cs
- CustomSignedXml.cs
- JournalNavigationScope.cs
- GroupStyle.cs
- SchemaNotation.cs
- BackoffTimeoutHelper.cs
- Point3DValueSerializer.cs
- BevelBitmapEffect.cs
- TransactionContext.cs
- SpinWait.cs
- FrameworkObject.cs
- AssemblyBuilder.cs
- WebPartZone.cs
- SignerInfo.cs
- GroupBox.cs
- EngineSiteSapi.cs
- UnauthorizedWebPart.cs
- ToolStripArrowRenderEventArgs.cs
- Matrix3DStack.cs
- AppDomain.cs
- BulletChrome.cs
- PerspectiveCamera.cs
- PatternMatchRules.cs
- FamilyTypefaceCollection.cs
- Int64AnimationBase.cs
- SecurityUtils.cs
- ClientFormsIdentity.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- ThreadStartException.cs
- FieldBuilder.cs
- StagingAreaInputItem.cs
- LabelLiteral.cs
- CommandID.cs
- Component.cs
- CodeParameterDeclarationExpressionCollection.cs
- ConvertBinder.cs
- OutKeywords.cs
- OrderByQueryOptionExpression.cs
- IHttpResponseInternal.cs
- AssemblyHash.cs
- ExpressionContext.cs
- StructuralObject.cs
- XmlTextAttribute.cs
- MethodRental.cs
- SoapSchemaMember.cs
- TablePatternIdentifiers.cs
- TextServicesCompartmentContext.cs
- AuthenticationConfig.cs
- WorkflowOwnershipException.cs
- Maps.cs
- DbMetaDataFactory.cs
- WindowsEditBoxRange.cs
- BuildProvider.cs
- SiteMapDataSourceView.cs
- PropertiesTab.cs
- COM2Properties.cs
- ToolBarButton.cs
- dbdatarecord.cs
- TypeSystemProvider.cs
- SimpleTypeResolver.cs
- URLIdentityPermission.cs
- StreamWriter.cs
- CodeDomDesignerLoader.cs
- XmlWellformedWriter.cs
- OleDbErrorCollection.cs
- DataGridColumnFloatingHeader.cs
- ComponentResourceKey.cs
- DbProviderFactories.cs
- CryptoApi.cs
- Executor.cs
- StylusCaptureWithinProperty.cs
- IISUnsafeMethods.cs
- CancelRequestedQuery.cs
- SpecialFolderEnumConverter.cs
- TreeNodeBinding.cs
- FixedPage.cs
- TextCompositionEventArgs.cs