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
- ToolStripRenderer.cs
- ReadOnlyCollectionBase.cs
- CodeCatchClause.cs
- BamlBinaryReader.cs
- ElementsClipboardData.cs
- Sentence.cs
- DesignerTransaction.cs
- FormatException.cs
- TimeoutValidationAttribute.cs
- FusionWrap.cs
- WebPartHeaderCloseVerb.cs
- HandlerBase.cs
- EdmValidator.cs
- WindowShowOrOpenTracker.cs
- ConfigurationStrings.cs
- Resources.Designer.cs
- NativeWrapper.cs
- SiteOfOriginContainer.cs
- entityreference_tresulttype.cs
- VisualStateGroup.cs
- RegexWriter.cs
- selecteditemcollection.cs
- TextFindEngine.cs
- UnsafeNativeMethods.cs
- RowsCopiedEventArgs.cs
- ContainerParagraph.cs
- SafeBitVector32.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- ProfileBuildProvider.cs
- TextEncodedRawTextWriter.cs
- OrderedDictionary.cs
- HuffmanTree.cs
- MouseWheelEventArgs.cs
- DataTableTypeConverter.cs
- RijndaelCryptoServiceProvider.cs
- XslNumber.cs
- SafeLocalMemHandle.cs
- AttributeQuery.cs
- DataGridViewColumn.cs
- DependencyPropertyChangedEventArgs.cs
- ListViewContainer.cs
- DataGridViewImageColumn.cs
- ThemeDirectoryCompiler.cs
- TemplateLookupAction.cs
- BitmapEffectGeneralTransform.cs
- DrawingImage.cs
- HtmlFormWrapper.cs
- SevenBitStream.cs
- ListArgumentProvider.cs
- VisualStateChangedEventArgs.cs
- Point3D.cs
- GPStream.cs
- XPathNode.cs
- HtmlEncodedRawTextWriter.cs
- Content.cs
- SqlResolver.cs
- TransformDescriptor.cs
- SHA256Cng.cs
- NumberFormatInfo.cs
- counter.cs
- IDReferencePropertyAttribute.cs
- ImageFormat.cs
- Point3DCollectionValueSerializer.cs
- WebCategoryAttribute.cs
- CodeDirectoryCompiler.cs
- WebScriptServiceHostFactory.cs
- ObjectStateFormatter.cs
- SmtpReplyReader.cs
- ScriptingSectionGroup.cs
- UrlMappingsModule.cs
- TaskForm.cs
- Cursors.cs
- CollectionBase.cs
- MILUtilities.cs
- CheckBox.cs
- QuadraticBezierSegment.cs
- SqlAliaser.cs
- Matrix3D.cs
- XPathMessageFilterTable.cs
- ColorComboBox.cs
- ProxyWebPart.cs
- RegexMatch.cs
- XamlTreeBuilderBamlRecordWriter.cs
- HostExecutionContextManager.cs
- CodeSnippetExpression.cs
- UserUseLicenseDictionaryLoader.cs
- DetailsViewCommandEventArgs.cs
- RuleSet.cs
- ConnectionsZone.cs
- DesignTimeTemplateParser.cs
- StaticSiteMapProvider.cs
- RuntimeConfig.cs
- SystemParameters.cs
- WinFormsComponentEditor.cs
- TimelineGroup.cs
- QilIterator.cs
- CompressEmulationStream.cs
- AssemblyInfo.cs
- CompareValidator.cs
- WebPartDisplayModeEventArgs.cs