Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / Configuration / HttpModuleActionCollection.cs / 4 / HttpModuleActionCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.IO; using System.Text; using System.Web.Configuration; using System.Globalization; using System.Security.Permissions; // class HttpModulesSection [ConfigurationCollection(typeof(HttpModuleAction))] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class HttpModuleActionCollection : ConfigurationElementCollection { private static ConfigurationPropertyCollection _properties; static HttpModuleActionCollection() { // Property initialization _properties = new ConfigurationPropertyCollection(); } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } public HttpModuleActionCollection() : base(StringComparer.OrdinalIgnoreCase) { } public HttpModuleAction this[int index] { get { return (HttpModuleAction)BaseGet(index); } set { if (BaseGet(index) != null) { BaseRemoveAt(index); } BaseAdd(index, value); } } public int IndexOf(HttpModuleAction action) { return BaseIndexOf(action); } public void Add(HttpModuleAction httpModule) { BaseAdd(httpModule); } public void Remove(HttpModuleAction action) { BaseRemove(action.Key); } public void Remove(string name) { BaseRemove(name); } public void RemoveAt(int index) { BaseRemoveAt(index); } protected override ConfigurationElement CreateNewElement() { return new HttpModuleAction(); } protected override Object GetElementKey(ConfigurationElement element) { return ((HttpModuleAction)element).Key; } protected override bool IsElementRemovable(ConfigurationElement element) { HttpModuleAction module = (HttpModuleAction)element; if (BaseIndexOf(module) == -1) // does it exist? { if (HttpModuleAction.IsSpecialModuleName(module.Name)) { throw new ConfigurationErrorsException(SR.GetString( SR.Special_module_cannot_be_removed_manually, module.Name), module.FileName, module.LineNumber); } else { throw new ConfigurationErrorsException(SR.GetString( SR.Module_not_in_app, module.Name), module.FileName, module.LineNumber); } } return true; } public void Clear() { BaseClear(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.IO; using System.Text; using System.Web.Configuration; using System.Globalization; using System.Security.Permissions; // class HttpModulesSection [ConfigurationCollection(typeof(HttpModuleAction))] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class HttpModuleActionCollection : ConfigurationElementCollection { private static ConfigurationPropertyCollection _properties; static HttpModuleActionCollection() { // Property initialization _properties = new ConfigurationPropertyCollection(); } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } public HttpModuleActionCollection() : base(StringComparer.OrdinalIgnoreCase) { } public HttpModuleAction this[int index] { get { return (HttpModuleAction)BaseGet(index); } set { if (BaseGet(index) != null) { BaseRemoveAt(index); } BaseAdd(index, value); } } public int IndexOf(HttpModuleAction action) { return BaseIndexOf(action); } public void Add(HttpModuleAction httpModule) { BaseAdd(httpModule); } public void Remove(HttpModuleAction action) { BaseRemove(action.Key); } public void Remove(string name) { BaseRemove(name); } public void RemoveAt(int index) { BaseRemoveAt(index); } protected override ConfigurationElement CreateNewElement() { return new HttpModuleAction(); } protected override Object GetElementKey(ConfigurationElement element) { return ((HttpModuleAction)element).Key; } protected override bool IsElementRemovable(ConfigurationElement element) { HttpModuleAction module = (HttpModuleAction)element; if (BaseIndexOf(module) == -1) // does it exist? { if (HttpModuleAction.IsSpecialModuleName(module.Name)) { throw new ConfigurationErrorsException(SR.GetString( SR.Special_module_cannot_be_removed_manually, module.Name), module.FileName, module.LineNumber); } else { throw new ConfigurationErrorsException(SR.GetString( SR.Module_not_in_app, module.Name), module.FileName, module.LineNumber); } } return true; } public void Clear() { BaseClear(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypeUtils.cs
- AutomationProperties.cs
- CurrentChangingEventArgs.cs
- WinInet.cs
- XmlSchemaAnyAttribute.cs
- CompiledQuery.cs
- ZipArchive.cs
- FakeModelPropertyImpl.cs
- DtrList.cs
- EnumValidator.cs
- SmtpCommands.cs
- UpdatePanelTrigger.cs
- SpinLock.cs
- ByteKeyFrameCollection.cs
- SchemaNotation.cs
- SmiGettersStream.cs
- ISFClipboardData.cs
- ConfigurationSchemaErrors.cs
- Helpers.cs
- WebSysDescriptionAttribute.cs
- UrlAuthFailedErrorFormatter.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- WindowsImpersonationContext.cs
- XamlToRtfWriter.cs
- WebPartEditorCancelVerb.cs
- XmlSerializationWriter.cs
- EmbeddedObject.cs
- HttpPostLocalhostServerProtocol.cs
- SynchronizedDispatch.cs
- IriParsingElement.cs
- HashJoinQueryOperatorEnumerator.cs
- PathSegment.cs
- iisPickupDirectory.cs
- SafeHandles.cs
- WindowsImpersonationContext.cs
- StatusBarPanelClickEvent.cs
- ContextDataSourceContextData.cs
- XmlCustomFormatter.cs
- SendingRequestEventArgs.cs
- InputDevice.cs
- ReachVisualSerializer.cs
- ActivityValidator.cs
- SiteMapHierarchicalDataSourceView.cs
- XamlTemplateSerializer.cs
- ButtonBaseAdapter.cs
- ConfigPathUtility.cs
- FlowDocument.cs
- VisualStyleElement.cs
- EntityContainerEmitter.cs
- WebContext.cs
- SiteMapNode.cs
- AxParameterData.cs
- MailBnfHelper.cs
- JsonClassDataContract.cs
- PerspectiveCamera.cs
- Mouse.cs
- RijndaelManagedTransform.cs
- DataGridViewColumn.cs
- LinkedList.cs
- SimpleHandlerFactory.cs
- EncodingNLS.cs
- SettingsPropertyNotFoundException.cs
- TreeViewImageIndexConverter.cs
- IntAverageAggregationOperator.cs
- DbConnectionOptions.cs
- validationstate.cs
- FilterQueryOptionExpression.cs
- HttpEncoderUtility.cs
- CalendarAutoFormatDialog.cs
- CleanUpVirtualizedItemEventArgs.cs
- SHA1Managed.cs
- ConfigUtil.cs
- DynamicPropertyReader.cs
- AssemblyAttributesGoHere.cs
- Baml2006Reader.cs
- InvalidProgramException.cs
- Base64Stream.cs
- XmlBoundElement.cs
- DBPropSet.cs
- QueryStringConverter.cs
- CornerRadiusConverter.cs
- ChannelManager.cs
- PeerTransportListenAddressConverter.cs
- ComponentCollection.cs
- ListBox.cs
- CalendarTable.cs
- StreamHelper.cs
- RequiredFieldValidator.cs
- ConnectionManagementElementCollection.cs
- DataRowExtensions.cs
- FlowDocumentScrollViewer.cs
- SizeAnimationUsingKeyFrames.cs
- DataServiceRequestArgs.cs
- IndentTextWriter.cs
- DateTimeConverter.cs
- Vector3DKeyFrameCollection.cs
- Int16Converter.cs
- TextContainerHelper.cs
- RoutedEventHandlerInfo.cs
- PathParser.cs