Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Configuration / BypassElementCollection.cs / 1305376 / BypassElementCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Configuration { using System; using System.Configuration; using System.Security.Permissions; [ConfigurationCollection(typeof(BypassElement))] public sealed class BypassElementCollection : ConfigurationElementCollection { public BypassElementCollection() { } public BypassElement this[int index] { get { return (BypassElement)BaseGet(index); } set { if (BaseGet(index) != null) { BaseRemoveAt(index); } BaseAdd(index,value); } } public new BypassElement this[string name] { get { return (BypassElement)BaseGet(name); } set { if (BaseGet(name) != null) { BaseRemove(name); } BaseAdd(value); } } public void Add(BypassElement element) { BaseAdd(element); } public void Clear() { BaseClear(); } protected override ConfigurationElement CreateNewElement() { return new BypassElement(); } protected override Object GetElementKey(ConfigurationElement element) { if (element == null) throw new ArgumentNullException("element"); return ((BypassElement)element).Key; } public int IndexOf(BypassElement element) { return BaseIndexOf(element); } public void Remove(BypassElement element) { if (element == null) throw new ArgumentNullException("element"); BaseRemove(element.Key); } public void Remove(string name) { BaseRemove(name); } public void RemoveAt(int index) { BaseRemoveAt(index); } // Since, ByPassElementCollection is a simple list with add/remove functionality, // we now never throw on duplicate entries just for this collection. This also // allows to keep Everett compatibility. // protected override bool ThrowOnDuplicate { get { return false; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Configuration { using System; using System.Configuration; using System.Security.Permissions; [ConfigurationCollection(typeof(BypassElement))] public sealed class BypassElementCollection : ConfigurationElementCollection { public BypassElementCollection() { } public BypassElement this[int index] { get { return (BypassElement)BaseGet(index); } set { if (BaseGet(index) != null) { BaseRemoveAt(index); } BaseAdd(index,value); } } public new BypassElement this[string name] { get { return (BypassElement)BaseGet(name); } set { if (BaseGet(name) != null) { BaseRemove(name); } BaseAdd(value); } } public void Add(BypassElement element) { BaseAdd(element); } public void Clear() { BaseClear(); } protected override ConfigurationElement CreateNewElement() { return new BypassElement(); } protected override Object GetElementKey(ConfigurationElement element) { if (element == null) throw new ArgumentNullException("element"); return ((BypassElement)element).Key; } public int IndexOf(BypassElement element) { return BaseIndexOf(element); } public void Remove(BypassElement element) { if (element == null) throw new ArgumentNullException("element"); BaseRemove(element.Key); } public void Remove(string name) { BaseRemove(name); } public void RemoveAt(int index) { BaseRemoveAt(index); } // Since, ByPassElementCollection is a simple list with add/remove functionality, // we now never throw on duplicate entries just for this collection. This also // allows to keep Everett compatibility. // protected override bool ThrowOnDuplicate { get { return false; } } } } // 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
- HtmlInputHidden.cs
- XmlAttributeCollection.cs
- EntityUtil.cs
- ToolboxComponentsCreatedEventArgs.cs
- ControlPersister.cs
- KnownTypesProvider.cs
- WmlLabelAdapter.cs
- BitmapSource.cs
- RawStylusSystemGestureInputReport.cs
- StreamUpdate.cs
- ZipIOCentralDirectoryBlock.cs
- ImplicitInputBrush.cs
- DbCommandTree.cs
- Internal.cs
- StorageModelBuildProvider.cs
- TransformCollection.cs
- OverlappedAsyncResult.cs
- ClientFormsAuthenticationCredentials.cs
- SystemUdpStatistics.cs
- InvalidFilterCriteriaException.cs
- ScrollChrome.cs
- OutOfMemoryException.cs
- Emitter.cs
- Triangle.cs
- ImageAttributes.cs
- Repeater.cs
- EntityDataSourceDesigner.cs
- SqlDataSourceView.cs
- _SSPIWrapper.cs
- XPathAxisIterator.cs
- XmlILAnnotation.cs
- UIPermission.cs
- MeasureItemEvent.cs
- HtmlShim.cs
- DbConnectionPoolCounters.cs
- X509Extension.cs
- RadioButton.cs
- NonPrimarySelectionGlyph.cs
- PngBitmapDecoder.cs
- HttpDictionary.cs
- BinHexDecoder.cs
- SerializerDescriptor.cs
- UrlPropertyAttribute.cs
- GcSettings.cs
- TableCellCollection.cs
- SessionPageStateSection.cs
- TableHeaderCell.cs
- SizeAnimationClockResource.cs
- DataSourceSelectArguments.cs
- Light.cs
- DropShadowBitmapEffect.cs
- Pair.cs
- StringSource.cs
- ByteStack.cs
- DesignBindingPropertyDescriptor.cs
- StyleTypedPropertyAttribute.cs
- QEncodedStream.cs
- BaseValidator.cs
- UnsafeNativeMethods.cs
- ProcessHostMapPath.cs
- ClaimSet.cs
- SiteMapDesignerDataSourceView.cs
- UriExt.cs
- ListViewUpdatedEventArgs.cs
- PermissionAttributes.cs
- CodeDirectoryCompiler.cs
- BitmapEffectDrawingContent.cs
- ResourcesBuildProvider.cs
- QueueProcessor.cs
- ElementAction.cs
- SingleAnimationBase.cs
- Pair.cs
- DataGridViewBindingCompleteEventArgs.cs
- FunctionQuery.cs
- CalendarDay.cs
- PrimitiveType.cs
- DesignerFrame.cs
- ReadOnlyHierarchicalDataSourceView.cs
- dsa.cs
- DrawingDrawingContext.cs
- MessageQueuePermissionEntry.cs
- BitmapEffectInputData.cs
- DictionaryTraceRecord.cs
- HtmlInputCheckBox.cs
- InteropBitmapSource.cs
- TagNameToTypeMapper.cs
- HttpRequestWrapper.cs
- GridItemProviderWrapper.cs
- PropertyInformationCollection.cs
- ServiceModelStringsVersion1.cs
- SamlAction.cs
- ProfilePropertySettings.cs
- CatalogZone.cs
- ObjectTag.cs
- HostingPreferredMapPath.cs
- TableParagraph.cs
- NodeInfo.cs
- EmptyElement.cs
- CallId.cs
- SimpleLine.cs