Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- EventLogPermissionEntryCollection.cs
- RouteParser.cs
- DSASignatureDeformatter.cs
- Run.cs
- BindUriHelper.cs
- TitleStyle.cs
- DataDocumentXPathNavigator.cs
- SystemIcmpV6Statistics.cs
- EntryIndex.cs
- ObjectStateFormatter.cs
- CodeIterationStatement.cs
- RubberbandSelector.cs
- PageEventArgs.cs
- FaultCode.cs
- Latin1Encoding.cs
- SHA256Managed.cs
- AnonymousIdentificationModule.cs
- FieldToken.cs
- WebHeaderCollection.cs
- log.cs
- StringToken.cs
- Comparer.cs
- CacheDependency.cs
- XmlSchemaDatatype.cs
- EntityTransaction.cs
- XmlWriterTraceListener.cs
- SafeFileMapViewHandle.cs
- XmlObjectSerializer.cs
- TextSelection.cs
- TPLETWProvider.cs
- ArglessEventHandlerProxy.cs
- XamlInterfaces.cs
- HtmlInputReset.cs
- ThemeDirectoryCompiler.cs
- IntegerValidator.cs
- _LocalDataStore.cs
- DynamicRenderer.cs
- HierarchicalDataSourceControl.cs
- WebPartMinimizeVerb.cs
- CompilationRelaxations.cs
- RectangleHotSpot.cs
- EntityClassGenerator.cs
- recordstate.cs
- IndependentAnimationStorage.cs
- ComponentConverter.cs
- CursorInteropHelper.cs
- XmlNodeComparer.cs
- ServicePointManagerElement.cs
- ReachPageContentCollectionSerializerAsync.cs
- NotFiniteNumberException.cs
- StreamWriter.cs
- MgmtConfigurationRecord.cs
- __ComObject.cs
- IItemProperties.cs
- DirectoryInfo.cs
- ExpressionBuilder.cs
- InfoCardConstants.cs
- IPAddressCollection.cs
- SqlClientWrapperSmiStream.cs
- ContentDefinition.cs
- CompoundFileIOPermission.cs
- TrueReadOnlyCollection.cs
- CodeStatementCollection.cs
- BinaryNode.cs
- HwndHost.cs
- ServiceElement.cs
- EditingMode.cs
- TransformedBitmap.cs
- ListDictionary.cs
- TextRenderer.cs
- CredentialCache.cs
- ExitEventArgs.cs
- ScopelessEnumAttribute.cs
- DataGridParentRows.cs
- SmtpAuthenticationManager.cs
- ToolStripPanelRow.cs
- InvokePatternIdentifiers.cs
- ErrorProvider.cs
- LiteralControl.cs
- ErrorStyle.cs
- PropertyKey.cs
- StagingAreaInputItem.cs
- LazyTextWriterCreator.cs
- RelationshipEndCollection.cs
- AssemblyInfo.cs
- DelegateSerializationHolder.cs
- DataBoundControlAdapter.cs
- ShaderRenderModeValidation.cs
- MetafileHeaderWmf.cs
- ParallelSeparator.xaml.cs
- SuppressIldasmAttribute.cs
- __TransparentProxy.cs
- ExtendedPropertyInfo.cs
- SqlBuffer.cs
- VisualSerializer.cs
- TaiwanCalendar.cs
- ISessionStateStore.cs
- StateDesigner.CommentLayoutGlyph.cs
- NavigatingCancelEventArgs.cs
- WebPartEventArgs.cs