Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- IdnMapping.cs
- HatchBrush.cs
- TraceHwndHost.cs
- ClientEventManager.cs
- InvalidWMPVersionException.cs
- DebugManager.cs
- CodeExporter.cs
- PermissionRequestEvidence.cs
- AdornedElementPlaceholder.cs
- SynchronousChannelMergeEnumerator.cs
- ApplyImportsAction.cs
- SetIterators.cs
- HelpInfo.cs
- SEHException.cs
- StringConverter.cs
- CriticalExceptions.cs
- ChtmlCalendarAdapter.cs
- TdsEnums.cs
- NamedObject.cs
- BeginStoryboard.cs
- CallbackException.cs
- Stacktrace.cs
- SoapHeaderAttribute.cs
- SamlAuthorityBinding.cs
- StateWorkerRequest.cs
- MutexSecurity.cs
- CacheOutputQuery.cs
- ResourceWriter.cs
- SessionIDManager.cs
- ApplicationServiceManager.cs
- UnionCodeGroup.cs
- MenuCommand.cs
- PersonalizationProviderHelper.cs
- GradientBrush.cs
- JsonServiceDocumentSerializer.cs
- DecimalConstantAttribute.cs
- Timeline.cs
- ModuleBuilder.cs
- Pens.cs
- RegexCode.cs
- InputBinding.cs
- ThicknessKeyFrameCollection.cs
- CacheManager.cs
- WorkflowApplicationIdleEventArgs.cs
- ServiceModelConfiguration.cs
- AlphaSortedEnumConverter.cs
- MemberInfoSerializationHolder.cs
- DispatchWrapper.cs
- DictionarySectionHandler.cs
- ValueOfAction.cs
- LogicalExpr.cs
- ParentUndoUnit.cs
- securitymgrsite.cs
- StrokeNode.cs
- UIElementParagraph.cs
- LineBreak.cs
- ModifiableIteratorCollection.cs
- BrowserCapabilitiesCodeGenerator.cs
- Registry.cs
- TextEndOfSegment.cs
- CodeThrowExceptionStatement.cs
- ContentElement.cs
- VirtualPathUtility.cs
- UIPermission.cs
- WasHostedComPlusFactory.cs
- SafeMILHandle.cs
- XamlDesignerSerializationManager.cs
- ToolboxItemLoader.cs
- CopyNodeSetAction.cs
- XmlAttributeOverrides.cs
- _FtpDataStream.cs
- TaskFileService.cs
- ObjectDataSourceView.cs
- Peer.cs
- MsmqSecureHashAlgorithm.cs
- ContainerParagraph.cs
- SpotLight.cs
- SemanticResolver.cs
- EncodingStreamWrapper.cs
- ConfigUtil.cs
- RayHitTestParameters.cs
- PackageDigitalSignatureManager.cs
- OrderedDictionary.cs
- DynamicActivityProperty.cs
- WindowsMenu.cs
- HttpClientCertificate.cs
- ScriptManager.cs
- TimeManager.cs
- WebBrowserEvent.cs
- ExtensionSimplifierMarkupObject.cs
- CodeTypeMember.cs
- Argument.cs
- QueryStringParameter.cs
- SessionPageStateSection.cs
- ZipIOCentralDirectoryBlock.cs
- Soap.cs
- RoleManagerModule.cs
- InstanceDataCollectionCollection.cs
- Paragraph.cs
- InkPresenterAutomationPeer.cs