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
- DataRow.cs
- MutexSecurity.cs
- AppDomainManager.cs
- CredentialManagerDialog.cs
- PackageProperties.cs
- FutureFactory.cs
- ConfigXmlComment.cs
- PreservationFileWriter.cs
- Catch.cs
- WindowsEditBox.cs
- SelfIssuedAuthAsymmetricKey.cs
- Filter.cs
- MbpInfo.cs
- COM2EnumConverter.cs
- TextSegment.cs
- DecoratedNameAttribute.cs
- ComContractElementCollection.cs
- GridPattern.cs
- Wow64ConfigurationLoader.cs
- GuidTagList.cs
- KeyValueConfigurationCollection.cs
- DATA_BLOB.cs
- DeferredElementTreeState.cs
- CheckBoxBaseAdapter.cs
- SiteMapNodeCollection.cs
- ThreadAbortException.cs
- X509WindowsSecurityToken.cs
- TreeViewAutomationPeer.cs
- SqlBooleanMismatchVisitor.cs
- ManagementExtension.cs
- ScrollChrome.cs
- DataGridViewImageColumn.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- TripleDES.cs
- QueryInterceptorAttribute.cs
- PeerNameRegistration.cs
- EventLogTraceListener.cs
- SoapException.cs
- activationcontext.cs
- _AcceptOverlappedAsyncResult.cs
- ImageMapEventArgs.cs
- WebPartConnectionCollection.cs
- SingleKeyFrameCollection.cs
- Rect3DValueSerializer.cs
- DeviceOverridableAttribute.cs
- Binding.cs
- InternalPermissions.cs
- Propagator.cs
- StreamingContext.cs
- InvokeProviderWrapper.cs
- WinOEToolBoxItem.cs
- DataBindingCollection.cs
- QueueProcessor.cs
- CodeCommentStatement.cs
- Cell.cs
- ProfileInfo.cs
- UrlPath.cs
- ValidatingReaderNodeData.cs
- Byte.cs
- ThrowHelper.cs
- ReadOnlyCollectionBase.cs
- GridViewRowCollection.cs
- PasswordDeriveBytes.cs
- ResourceReferenceExpression.cs
- SqlFacetAttribute.cs
- ResolveNextArgumentWorkItem.cs
- ExternalFile.cs
- GroupBoxRenderer.cs
- CompilationSection.cs
- PropertyOrder.cs
- ExpressionConverter.cs
- _UncName.cs
- TypeInitializationException.cs
- XXXOnTypeBuilderInstantiation.cs
- D3DImage.cs
- MDIWindowDialog.cs
- StringSorter.cs
- Code.cs
- DynamicDataRoute.cs
- ContentWrapperAttribute.cs
- RtfNavigator.cs
- BindableAttribute.cs
- ButtonRenderer.cs
- EmptyEnumerator.cs
- DesignerActionService.cs
- DataBinding.cs
- NodeLabelEditEvent.cs
- DisplayInformation.cs
- RIPEMD160Managed.cs
- MgmtConfigurationRecord.cs
- DataServiceOperationContext.cs
- PriorityQueue.cs
- WebConfigurationHostFileChange.cs
- XhtmlBasicTextViewAdapter.cs
- Int64Converter.cs
- BitmapEffect.cs
- IDQuery.cs
- WindowsListViewScroll.cs
- ArraySubsetEnumerator.cs
- KeyBinding.cs