Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / UI / PageHandlerFactory.cs / 1 / PageHandlerFactory.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * Handler Factory implementation for Page files * * Copyright (c) 1999 Microsoft Corporation */ namespace System.Web.UI { using System.Runtime.Serialization.Formatters; using System.IO; using System.Security.Permissions; using System.Web.Compilation; using System.Web.Util; using Debug=System.Web.Util.Debug; /* * Handler Factory implementation for ASP.NET files */ [PermissionSet(SecurityAction.LinkDemand, Unrestricted = true)] [PermissionSet(SecurityAction.InheritanceDemand, Unrestricted=true)] public class PageHandlerFactory : IHttpHandlerFactory2 { private bool _isInheritedInstance; protected internal PageHandlerFactory() { // Check whether this is the exact PageHandlerFactory, or a derived class _isInheritedInstance = (GetType() != typeof(PageHandlerFactory)); } public virtual IHttpHandler GetHandler(HttpContext context, string requestType, string virtualPath, string path) { Debug.Trace("PageHandlerFactory", "PageHandlerFactory: " + virtualPath); // This should never get called in ISAPI mode but currently is in integrated mode // Debug.Assert(false); return GetHandlerHelper(context, requestType, VirtualPath.CreateNonRelative(virtualPath), path); } IHttpHandler IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) { // If it's a derived class, we must call the old (less efficient) GetHandler, in // case it was overriden if (_isInheritedInstance) { return GetHandler(context, requestType, virtualPath.VirtualPathString, physicalPath); } return GetHandlerHelper(context, requestType, virtualPath, physicalPath); } public virtual void ReleaseHandler(IHttpHandler handler) { } private IHttpHandler GetHandlerHelper(HttpContext context, string requestType, VirtualPath virtualPath, string physicalPath) { Page page = BuildManager.CreateInstanceFromVirtualPath( virtualPath, typeof(Page), context, true /*allowCrossApp*/, true /*noAssert*/) as Page; if (page == null) return null; page.TemplateControlVirtualPath = virtualPath; return page; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * Handler Factory implementation for Page files * * Copyright (c) 1999 Microsoft Corporation */ namespace System.Web.UI { using System.Runtime.Serialization.Formatters; using System.IO; using System.Security.Permissions; using System.Web.Compilation; using System.Web.Util; using Debug=System.Web.Util.Debug; /* * Handler Factory implementation for ASP.NET files */ [PermissionSet(SecurityAction.LinkDemand, Unrestricted = true)] [PermissionSet(SecurityAction.InheritanceDemand, Unrestricted=true)] public class PageHandlerFactory : IHttpHandlerFactory2 { private bool _isInheritedInstance; protected internal PageHandlerFactory() { // Check whether this is the exact PageHandlerFactory, or a derived class _isInheritedInstance = (GetType() != typeof(PageHandlerFactory)); } public virtual IHttpHandler GetHandler(HttpContext context, string requestType, string virtualPath, string path) { Debug.Trace("PageHandlerFactory", "PageHandlerFactory: " + virtualPath); // This should never get called in ISAPI mode but currently is in integrated mode // Debug.Assert(false); return GetHandlerHelper(context, requestType, VirtualPath.CreateNonRelative(virtualPath), path); } IHttpHandler IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) { // If it's a derived class, we must call the old (less efficient) GetHandler, in // case it was overriden if (_isInheritedInstance) { return GetHandler(context, requestType, virtualPath.VirtualPathString, physicalPath); } return GetHandlerHelper(context, requestType, virtualPath, physicalPath); } public virtual void ReleaseHandler(IHttpHandler handler) { } private IHttpHandler GetHandlerHelper(HttpContext context, string requestType, VirtualPath virtualPath, string physicalPath) { Page page = BuildManager.CreateInstanceFromVirtualPath( virtualPath, typeof(Page), context, true /*allowCrossApp*/, true /*noAssert*/) as Page; if (page == null) return null; page.TemplateControlVirtualPath = virtualPath; return page; } } } // 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
- CompositeFontFamily.cs
- DataView.cs
- SmtpFailedRecipientException.cs
- MemberDomainMap.cs
- TagMapCollection.cs
- Viewport3DVisual.cs
- ScriptResourceHandler.cs
- EntityDataSourceReferenceGroup.cs
- CoordinationService.cs
- ImmutablePropertyDescriptorGridEntry.cs
- IPAddressCollection.cs
- DbMetaDataFactory.cs
- GridViewDeletedEventArgs.cs
- DataBindEngine.cs
- ScalarType.cs
- PartitionResolver.cs
- ProfileEventArgs.cs
- PrintingPermissionAttribute.cs
- LocatorGroup.cs
- OdbcConnectionStringbuilder.cs
- ItemMap.cs
- NetCodeGroup.cs
- XmlnsDefinitionAttribute.cs
- DataControlFieldCollection.cs
- LoadRetryAsyncResult.cs
- InheritanceContextChangedEventManager.cs
- Vector3D.cs
- RegistrySecurity.cs
- DataServiceQueryProvider.cs
- FontCacheLogic.cs
- webproxy.cs
- FormatterServicesNoSerializableCheck.cs
- GroupByQueryOperator.cs
- StringAnimationUsingKeyFrames.cs
- LinearKeyFrames.cs
- SurrogateEncoder.cs
- MatrixCamera.cs
- HierarchicalDataBoundControlAdapter.cs
- InputScope.cs
- EventMappingSettings.cs
- StorageAssociationTypeMapping.cs
- CharacterMetricsDictionary.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- PenContext.cs
- ACL.cs
- BinaryConverter.cs
- FontNamesConverter.cs
- UrlMappingCollection.cs
- OleDbError.cs
- BaseTemplateBuildProvider.cs
- SectionUpdates.cs
- ListViewContainer.cs
- _NtlmClient.cs
- TableStyle.cs
- _ProxyChain.cs
- mediapermission.cs
- Decimal.cs
- DataGridViewAutoSizeModeEventArgs.cs
- ErrorEventArgs.cs
- BuildDependencySet.cs
- WebSysDefaultValueAttribute.cs
- ReflectTypeDescriptionProvider.cs
- _FtpControlStream.cs
- WindowsEditBox.cs
- AttachedPropertyBrowsableAttribute.cs
- ProjectionCamera.cs
- EntityAdapter.cs
- EntityDesignPluralizationHandler.cs
- MatrixTransform.cs
- Token.cs
- HeaderUtility.cs
- cookie.cs
- Tool.cs
- DataGridViewLinkColumn.cs
- AppDomainFactory.cs
- InvokeAction.cs
- ExpressionBuilderContext.cs
- SoapEnvelopeProcessingElement.cs
- UnsafeNativeMethods.cs
- UrlRoutingModule.cs
- EnumValAlphaComparer.cs
- XamlToRtfParser.cs
- GroupItem.cs
- ApplicationActivator.cs
- SafeEventLogWriteHandle.cs
- SyndicationSerializer.cs
- SafeCoTaskMem.cs
- controlskin.cs
- CfgParser.cs
- LocalizationComments.cs
- GenericParameterDataContract.cs
- GraphicsContext.cs
- XmlMapping.cs
- XPathBinder.cs
- AssemblyInfo.cs
- StreamGeometry.cs
- ExplicitDiscriminatorMap.cs
- Monitor.cs
- RemoteAsymmetricSignatureFormatter.cs
- regiisutil.cs