Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / ModulesEntry.cs / 1305376 / ModulesEntry.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
* Config related classes for HttpApplication
*
*/
namespace System.Web.Configuration.Common {
using System.Runtime.Serialization.Formatters;
using System.Threading;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.Collections;
using System.Reflection;
using System.Globalization;
using System.Configuration;
using System.Web;
using System.Web.SessionState;
using System.Web.Security;
using System.Web.Util;
using System.Web.Compilation;
using System.Security;
using System.Security.Permissions;
/*
* Single Entry of request to class
*/
internal class ModulesEntry {
private String _name;
private Type _type;
internal ModulesEntry(String name, String typeName, string propertyName, ConfigurationElement configElement) {
_name = (name != null) ? name : String.Empty;
// Don't check the APTCA bit for modules (VSWhidbey 467768, 550122)
_type = SecureGetType(typeName, propertyName, configElement);
if (!typeof(IHttpModule).IsAssignableFrom(_type)) {
if (configElement == null) {
throw new ConfigurationErrorsException(SR.GetString(SR.Type_not_module, typeName));
}
else {
throw new ConfigurationErrorsException(SR.GetString(SR.Type_not_module, typeName),
configElement.ElementInformation.Properties["type"].Source, configElement.ElementInformation.Properties["type"].LineNumber);
}
}
}
internal static bool IsTypeMatch(Type type, String typeName) {
return(type.Name.Equals(typeName) || type.FullName.Equals(typeName));
}
internal String ModuleName {
get { return _name; }
}
internal /*public*/ IHttpModule Create() {
return (IHttpModule)HttpRuntime.CreateNonPublicInstance(_type);
}
[PermissionSet(SecurityAction.Assert, Unrestricted=true)]
private Type SecureGetType(string typeName, string propertyName, ConfigurationElement configElement) {
return ConfigUtil.GetType(typeName, propertyName, configElement, false /*checkAptcaBit*/);
}
}
}
// 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
- LineServicesRun.cs
- IdentityElement.cs
- MemberNameValidator.cs
- LassoHelper.cs
- BinaryNode.cs
- RequestReplyCorrelator.cs
- MatrixValueSerializer.cs
- IndexerNameAttribute.cs
- ShaderEffect.cs
- TextAdaptor.cs
- CodeChecksumPragma.cs
- InternalReceiveMessage.cs
- RootProfilePropertySettingsCollection.cs
- EventProviderWriter.cs
- AppSettingsReader.cs
- ConsoleKeyInfo.cs
- MulticastNotSupportedException.cs
- BinaryMethodMessage.cs
- CallId.cs
- DecimalMinMaxAggregationOperator.cs
- Utilities.cs
- ImageClickEventArgs.cs
- Label.cs
- TraceContextRecord.cs
- ILGen.cs
- ConnectionStringsSection.cs
- HttpWriter.cs
- SharedConnectionWorkflowTransactionService.cs
- AccessorTable.cs
- ServiceX509SecurityTokenProvider.cs
- BrowserCapabilitiesFactoryBase.cs
- SqlFunctionAttribute.cs
- StreamGeometry.cs
- TemplateField.cs
- WorkflowOperationAsyncResult.cs
- ConnectionManager.cs
- RequestDescription.cs
- CompositeControl.cs
- MediaScriptCommandRoutedEventArgs.cs
- JsonStringDataContract.cs
- PeerContact.cs
- TerminateWorkflow.cs
- CfgRule.cs
- CalendarDay.cs
- RuleProcessor.cs
- LightweightCodeGenerator.cs
- WeakReferenceList.cs
- Collection.cs
- StyleSelector.cs
- LambdaCompiler.cs
- SectionXmlInfo.cs
- XmlReflectionMember.cs
- QilIterator.cs
- BaseValidator.cs
- CodeDomDesignerLoader.cs
- HtmlTableRowCollection.cs
- SeekStoryboard.cs
- MonthCalendarDesigner.cs
- CompatibleIComparer.cs
- DataControlImageButton.cs
- ExpressionBinding.cs
- LoadedEvent.cs
- RewritingPass.cs
- CustomErrorsSection.cs
- SplashScreenNativeMethods.cs
- PassportPrincipal.cs
- TextEditorSpelling.cs
- DataViewManager.cs
- ContentControl.cs
- DataGridViewElement.cs
- ConfigurationLocationCollection.cs
- EncryptedPackage.cs
- FamilyTypeface.cs
- FilterElement.cs
- BoundColumn.cs
- SafeBitVector32.cs
- BinaryQueryOperator.cs
- WebHttpBinding.cs
- ModifierKeysConverter.cs
- ThreadStateException.cs
- TypeBuilderInstantiation.cs
- StyleReferenceConverter.cs
- XmlDomTextWriter.cs
- MailSettingsSection.cs
- WebServiceClientProxyGenerator.cs
- RelationHandler.cs
- ChangeDirector.cs
- DisplayMemberTemplateSelector.cs
- Properties.cs
- SiteMapDataSourceView.cs
- Base64Decoder.cs
- BulletChrome.cs
- DbProviderConfigurationHandler.cs
- PreservationFileReader.cs
- DefaultSerializationProviderAttribute.cs
- SqlVisitor.cs
- EventLogPermission.cs
- RegexCode.cs
- ImageSource.cs
- ActiveXContainer.cs