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
- ModelServiceImpl.cs
- ExtractorMetadata.cs
- XPathScanner.cs
- RuleRefElement.cs
- _DomainName.cs
- Screen.cs
- ExpandSegment.cs
- FormatterServices.cs
- XmlHelper.cs
- CompressedStack.cs
- XmlRawWriterWrapper.cs
- UnsafeNativeMethods.cs
- DesignerVerb.cs
- Point3D.cs
- OdbcFactory.cs
- ProxyElement.cs
- XmlSchemaIdentityConstraint.cs
- altserialization.cs
- WindowsMenu.cs
- WeakEventTable.cs
- XmlSequenceWriter.cs
- DelegateBodyWriter.cs
- HtmlControl.cs
- ConfigurationConverterBase.cs
- SymmetricSecurityBindingElement.cs
- WebPartTransformer.cs
- DataException.cs
- ObjectDataSourceSelectingEventArgs.cs
- DataGridViewTopRowAccessibleObject.cs
- NullableIntSumAggregationOperator.cs
- PeerSecurityManager.cs
- BinHexDecoder.cs
- SettingsBase.cs
- DefaultAsyncDataDispatcher.cs
- PagedDataSource.cs
- StringKeyFrameCollection.cs
- PrePrepareMethodAttribute.cs
- DoubleLinkList.cs
- WindowsUpDown.cs
- QilChoice.cs
- DependencyPropertyConverter.cs
- HtmlElementErrorEventArgs.cs
- DataDocumentXPathNavigator.cs
- SqlTypeSystemProvider.cs
- InputMethodStateChangeEventArgs.cs
- ComplexBindingPropertiesAttribute.cs
- XmlIncludeAttribute.cs
- VisualTreeUtils.cs
- ClientTargetSection.cs
- StreamGeometryContext.cs
- WebPartUserCapability.cs
- SafeNativeMethods.cs
- WMICapabilities.cs
- TreeWalkHelper.cs
- ServiceActivationException.cs
- BaseInfoTable.cs
- ToolZone.cs
- SqlConnectionHelper.cs
- DtrList.cs
- EventLogPermissionAttribute.cs
- DiagnosticsConfiguration.cs
- ChannelEndpointElement.cs
- EventRecord.cs
- AsyncResult.cs
- WorkflowInlining.cs
- XmlSchemaSimpleContent.cs
- View.cs
- TableSectionStyle.cs
- RowSpanVector.cs
- ProvidersHelper.cs
- COAUTHIDENTITY.cs
- XmlMemberMapping.cs
- RowBinding.cs
- ClientConvert.cs
- NumberFormatInfo.cs
- Transform3D.cs
- TypedReference.cs
- CharEnumerator.cs
- ToolStripButton.cs
- HostExecutionContextManager.cs
- ScrollChangedEventArgs.cs
- ProcessModule.cs
- BitmapDownload.cs
- MenuItemCollection.cs
- TypeForwardedToAttribute.cs
- UserNameSecurityToken.cs
- AdRotator.cs
- CodeMemberEvent.cs
- ToolboxDataAttribute.cs
- TraceSection.cs
- Int32RectConverter.cs
- NamespaceCollection.cs
- StreamReader.cs
- Merger.cs
- PtsHost.cs
- HostVisual.cs
- HiddenField.cs
- GlobalizationSection.cs
- Span.cs
- MessageFormatterConverter.cs