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
- CharEntityEncoderFallback.cs
- DataGridHeaderBorder.cs
- SQLInt64.cs
- ProfileSection.cs
- TransformedBitmap.cs
- FilteredAttributeCollection.cs
- latinshape.cs
- SoapMessage.cs
- DataList.cs
- ProcessInputEventArgs.cs
- CachingHintValidation.cs
- SystemInfo.cs
- BitmapFrame.cs
- GestureRecognitionResult.cs
- FormClosingEvent.cs
- ConstraintEnumerator.cs
- ConstraintConverter.cs
- FamilyCollection.cs
- ScrollContentPresenter.cs
- DockingAttribute.cs
- HttpRuntime.cs
- ZipIOModeEnforcingStream.cs
- GrammarBuilderWildcard.cs
- connectionpool.cs
- AdornerLayer.cs
- XslTransform.cs
- ModelFunction.cs
- SetterBase.cs
- DesignColumnCollection.cs
- CompensationTokenData.cs
- ScriptReferenceBase.cs
- ConfigurationManagerHelper.cs
- ManagedWndProcTracker.cs
- SqlBulkCopyColumnMapping.cs
- FontCacheUtil.cs
- MetadataException.cs
- XmlSubtreeReader.cs
- WebPartManagerInternals.cs
- SemaphoreFullException.cs
- SafeFileMappingHandle.cs
- Validator.cs
- SizeChangedEventArgs.cs
- OleDbException.cs
- InternalResources.cs
- NativeCppClassAttribute.cs
- MenuItemCollection.cs
- FileRecordSequenceHelper.cs
- ExportFileRequest.cs
- Flattener.cs
- RegexParser.cs
- ValidationErrorCollection.cs
- PolicyManager.cs
- WorkflowApplicationUnhandledExceptionEventArgs.cs
- SmtpDateTime.cs
- EventListener.cs
- CatalogPartChrome.cs
- AppDomainManager.cs
- FlowDocument.cs
- ToolBarTray.cs
- Switch.cs
- PagesChangedEventArgs.cs
- ParameterBuilder.cs
- Filter.cs
- PropertyStore.cs
- QueryOperationResponseOfT.cs
- DataControlFieldCell.cs
- FilterException.cs
- DesignTimeVisibleAttribute.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- nulltextcontainer.cs
- JavaScriptSerializer.cs
- DbProviderFactoriesConfigurationHandler.cs
- DataServiceRequest.cs
- StringResourceManager.cs
- ExpressionSelection.cs
- CommonDialog.cs
- SocketPermission.cs
- HttpResponseBase.cs
- DbConnectionPoolGroup.cs
- StateElement.cs
- StorageEntityTypeMapping.cs
- OleDbError.cs
- CorePropertiesFilter.cs
- HttpGetProtocolReflector.cs
- IsolatedStorageFileStream.cs
- NavigationProperty.cs
- EntitySqlQueryBuilder.cs
- Int16.cs
- EventDescriptor.cs
- QueryPageSettingsEventArgs.cs
- SrgsDocument.cs
- Context.cs
- MultiPropertyDescriptorGridEntry.cs
- SecurityImpersonationBehavior.cs
- TextBox.cs
- RC2.cs
- PathData.cs
- InputBinder.cs
- MenuItemStyleCollectionEditor.cs
- IgnorePropertiesAttribute.cs