Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / Configuration / HttpModuleActionCollection.cs / 3 / 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();
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DependencyPropertyDescriptor.cs
- SqlTriggerAttribute.cs
- LinkedResourceCollection.cs
- LocalizableAttribute.cs
- MetadataItemSerializer.cs
- GridViewRowEventArgs.cs
- SuppressMergeCheckAttribute.cs
- DataGridViewButtonCell.cs
- EdgeProfileValidation.cs
- IsolatedStoragePermission.cs
- CreateUserWizardAutoFormat.cs
- MultipartIdentifier.cs
- ConfigXmlWhitespace.cs
- StartUpEventArgs.cs
- OutputCacheSection.cs
- SqlTransaction.cs
- Stylesheet.cs
- FormViewInsertedEventArgs.cs
- ActivityScheduledQuery.cs
- TemplatePropertyEntry.cs
- ContainerParagraph.cs
- RequestReplyCorrelator.cs
- LinqDataSourceDisposeEventArgs.cs
- GrabHandleGlyph.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- BaseCodePageEncoding.cs
- MissingSatelliteAssemblyException.cs
- ReversePositionQuery.cs
- HelpKeywordAttribute.cs
- SecureStringHasher.cs
- MessageDroppedTraceRecord.cs
- Debug.cs
- XmlSchemaGroupRef.cs
- XDRSchema.cs
- NetCodeGroup.cs
- UInt16Storage.cs
- CardSpaceShim.cs
- TimelineClockCollection.cs
- BrowsableAttribute.cs
- NonBatchDirectoryCompiler.cs
- TraceSection.cs
- BulletChrome.cs
- ActiveXHost.cs
- PreservationFileWriter.cs
- bidPrivateBase.cs
- EmptyStringExpandableObjectConverter.cs
- SliderAutomationPeer.cs
- InputLanguageCollection.cs
- SchemaDeclBase.cs
- FormCollection.cs
- DrawItemEvent.cs
- ResourceIDHelper.cs
- RowToFieldTransformer.cs
- MissingMethodException.cs
- DataGridView.cs
- UrlMapping.cs
- IndentedTextWriter.cs
- AliasedSlot.cs
- DesignerActionGlyph.cs
- NotifyInputEventArgs.cs
- OutputCacheSettingsSection.cs
- StylusCollection.cs
- ZipArchive.cs
- DataGridViewIntLinkedList.cs
- CompositionAdorner.cs
- HttpModulesInstallComponent.cs
- RadioButton.cs
- RPIdentityRequirement.cs
- IntSecurity.cs
- IncrementalReadDecoders.cs
- InvokeSchedule.cs
- RegexMatchCollection.cs
- dataobject.cs
- TextPattern.cs
- DataGridCaption.cs
- Transform.cs
- FunctionOverloadResolver.cs
- BaseParser.cs
- AutomationPatternInfo.cs
- HMACSHA384.cs
- StrokeRenderer.cs
- EventLogEntry.cs
- ButtonAutomationPeer.cs
- ScriptingJsonSerializationSection.cs
- UpdateExpressionVisitor.cs
- ExternalCalls.cs
- TextFragmentEngine.cs
- WmlControlAdapter.cs
- EditorServiceContext.cs
- SessionStateUtil.cs
- AlignmentXValidation.cs
- _NegoState.cs
- AssemblyNameProxy.cs
- SizeAnimationClockResource.cs
- SetterBase.cs
- DbDeleteCommandTree.cs
- XmlNavigatorFilter.cs
- StrongNameUtility.cs
- SafeProcessHandle.cs
- documentsequencetextview.cs