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
- KoreanLunisolarCalendar.cs
- TdsValueSetter.cs
- RadialGradientBrush.cs
- HttpWriter.cs
- brushes.cs
- TypeDescriptionProviderAttribute.cs
- FrameworkRichTextComposition.cs
- SymLanguageType.cs
- DropDownButton.cs
- Underline.cs
- HostingEnvironmentWrapper.cs
- TableLayoutStyle.cs
- JavascriptCallbackMessageInspector.cs
- DataServiceRequestException.cs
- ByValueEqualityComparer.cs
- MultiTargetingUtil.cs
- TextSelectionProcessor.cs
- PageBreakRecord.cs
- WorkflowOwnerAsyncResult.cs
- BasePattern.cs
- TrackingServices.cs
- AttributeProviderAttribute.cs
- XmlEncoding.cs
- ISAPIApplicationHost.cs
- Cursors.cs
- SettingsBindableAttribute.cs
- WebErrorHandler.cs
- PathTooLongException.cs
- TextRunTypographyProperties.cs
- OwnerDrawPropertyBag.cs
- LZCodec.cs
- ThemeableAttribute.cs
- StyleCollection.cs
- WebControlsSection.cs
- PatternMatcher.cs
- WindowHelperService.cs
- XamlTreeBuilder.cs
- TrackingStringDictionary.cs
- Win32Exception.cs
- EntityDataSourceValidationException.cs
- XmlQueryTypeFactory.cs
- UpDownBase.cs
- SiteMembershipCondition.cs
- GeneralTransformGroup.cs
- FileDataSourceCache.cs
- SymmetricSecurityProtocolFactory.cs
- HashMembershipCondition.cs
- EmbeddedMailObject.cs
- VectorConverter.cs
- TraceContext.cs
- ComPlusSynchronizationContext.cs
- SafeCloseHandleCritical.cs
- _ShellExpression.cs
- ValidateNames.cs
- Selection.cs
- CultureInfo.cs
- FrameworkElement.cs
- XmlNode.cs
- wmiutil.cs
- AudioLevelUpdatedEventArgs.cs
- EngineSite.cs
- AffineTransform3D.cs
- XamlClipboardData.cs
- EditorPartDesigner.cs
- BrowserDefinitionCollection.cs
- EdmItemError.cs
- CultureTable.cs
- PackageDigitalSignature.cs
- DiscoveryClientOutputChannel.cs
- FastPropertyAccessor.cs
- ZipIOModeEnforcingStream.cs
- TraceListeners.cs
- EventLogEntry.cs
- XamlReaderHelper.cs
- DefaultPrintController.cs
- TimeZoneInfo.cs
- DateBoldEvent.cs
- SecUtil.cs
- Encoding.cs
- BitVector32.cs
- CompareValidator.cs
- WebPartConnectionsConfigureVerb.cs
- SecurityTokenResolver.cs
- WCFServiceClientProxyGenerator.cs
- HttpListenerElement.cs
- TraceRecords.cs
- AnnotationAdorner.cs
- OpenFileDialog.cs
- FontWeight.cs
- FormsAuthenticationUserCollection.cs
- ModelVisual3D.cs
- StructuralCache.cs
- TransactionManager.cs
- ParsedAttributeCollection.cs
- DataFieldEditor.cs
- TableSectionStyle.cs
- SymLanguageVendor.cs
- XmlSchemaChoice.cs
- BinaryCommonClasses.cs
- ValueOfAction.cs