Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / Configuration / HttpModuleActionCollection.cs / 5 / 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. // //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RequiredFieldValidator.cs
- XmlSchemaObjectCollection.cs
- WindowsProgressbar.cs
- EntityProxyTypeInfo.cs
- ClientConfigurationHost.cs
- ObjectAnimationUsingKeyFrames.cs
- COAUTHINFO.cs
- SimpleTypeResolver.cs
- BackoffTimeoutHelper.cs
- DbConnectionPoolCounters.cs
- clipboard.cs
- ToolboxItemCollection.cs
- RulePatternOps.cs
- Image.cs
- InputScopeManager.cs
- PeerContact.cs
- QualifiedCellIdBoolean.cs
- TypeForwardedFromAttribute.cs
- MessageSecurityProtocol.cs
- WindowsFormsLinkLabel.cs
- ReadonlyMessageFilter.cs
- DescriptionAttribute.cs
- CharacterMetricsDictionary.cs
- XPathSingletonIterator.cs
- ClientSideProviderDescription.cs
- SqlCommand.cs
- StrokeIntersection.cs
- SqlRewriteScalarSubqueries.cs
- GZipDecoder.cs
- TypeForwardedToAttribute.cs
- PublisherIdentityPermission.cs
- AuthenticationConfig.cs
- List.cs
- CodeBlockBuilder.cs
- xsdvalidator.cs
- PauseStoryboard.cs
- AssemblyBuilderData.cs
- DataTableReader.cs
- TargetParameterCountException.cs
- HtmlTableCell.cs
- GlobalProxySelection.cs
- WrapPanel.cs
- SqlDataSourceEnumerator.cs
- DesignerRegionMouseEventArgs.cs
- LayoutTable.cs
- ListManagerBindingsCollection.cs
- UserControlCodeDomTreeGenerator.cs
- DataObject.cs
- ImmutablePropertyDescriptorGridEntry.cs
- ParameterCollection.cs
- AutoCompleteStringCollection.cs
- HierarchicalDataSourceIDConverter.cs
- FileDialogCustomPlace.cs
- PersonalizationProviderHelper.cs
- HMACRIPEMD160.cs
- ControlAdapter.cs
- ScriptingProfileServiceSection.cs
- RadioButtonFlatAdapter.cs
- CheckBoxRenderer.cs
- MembershipPasswordException.cs
- ElementsClipboardData.cs
- SHA1CryptoServiceProvider.cs
- DBAsyncResult.cs
- GridItemPatternIdentifiers.cs
- NumericPagerField.cs
- CharacterHit.cs
- MetadataItem_Static.cs
- Rijndael.cs
- ToolboxItemLoader.cs
- RotateTransform3D.cs
- PinnedBufferMemoryStream.cs
- AudioFormatConverter.cs
- BulletedList.cs
- SignatureDescription.cs
- ExternalFile.cs
- SamlSubjectStatement.cs
- TextWriter.cs
- ObfuscateAssemblyAttribute.cs
- CreateUserErrorEventArgs.cs
- TextureBrush.cs
- RemotingConfiguration.cs
- WebPartConnectionsDisconnectVerb.cs
- BamlResourceContent.cs
- ApplicationException.cs
- PingReply.cs
- StrokeNodeOperations2.cs
- ConditionalAttribute.cs
- LostFocusEventManager.cs
- MetadataPropertyAttribute.cs
- RegexCompilationInfo.cs
- Int16.cs
- XmlCompatibilityReader.cs
- RayHitTestParameters.cs
- TextSegment.cs
- HttpProfileBase.cs
- keycontainerpermission.cs
- BaseTemplatedMobileComponentEditor.cs
- ExpandableObjectConverter.cs
- XmlQualifiedNameTest.cs
- SupportsEventValidationAttribute.cs