Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / UI / PageHandlerFactory.cs / 4 / 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
- SoapRpcMethodAttribute.cs
- SafeBitVector32.cs
- FontEmbeddingManager.cs
- UpDownBase.cs
- ActivityDesigner.cs
- TableAdapterManagerNameHandler.cs
- ImplicitInputBrush.cs
- Empty.cs
- FixedPosition.cs
- transactioncontext.cs
- FormatterConverter.cs
- Stroke.cs
- FileChangeNotifier.cs
- WebAdminConfigurationHelper.cs
- figurelengthconverter.cs
- ParamArrayAttribute.cs
- LicenseProviderAttribute.cs
- AppSettings.cs
- Visitors.cs
- AppPool.cs
- AuthenticationServiceManager.cs
- SapiRecoInterop.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- SharedPersonalizationStateInfo.cs
- Control.cs
- ExternalException.cs
- DataBindingCollectionConverter.cs
- NeutralResourcesLanguageAttribute.cs
- SynchronizedDispatch.cs
- FactoryGenerator.cs
- DynamicEntity.cs
- ApplicationBuildProvider.cs
- QueryResult.cs
- TextUtf8RawTextWriter.cs
- DES.cs
- ConfigurationManager.cs
- StoreContentChangedEventArgs.cs
- DialogResultConverter.cs
- EntityDesignerDataSourceView.cs
- TextAdaptor.cs
- errorpatternmatcher.cs
- RegexCompilationInfo.cs
- XmlSchemaSimpleContent.cs
- MouseButtonEventArgs.cs
- NativeMethods.cs
- WindowsPrincipal.cs
- HtmlElement.cs
- _OverlappedAsyncResult.cs
- CodeVariableReferenceExpression.cs
- Win32.cs
- HMACSHA384.cs
- XmlSignificantWhitespace.cs
- SmtpFailedRecipientsException.cs
- MobileContainerDesigner.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- DrawListViewSubItemEventArgs.cs
- WizardSideBarListControlItemEventArgs.cs
- WebHttpSecurityModeHelper.cs
- Process.cs
- PersonalizationProviderCollection.cs
- ParseHttpDate.cs
- EdmEntityTypeAttribute.cs
- ObjectDataSourceMethodEventArgs.cs
- CodeBlockBuilder.cs
- ScriptManagerProxy.cs
- DataColumnCollection.cs
- InkPresenterAutomationPeer.cs
- DesignTimeVisibleAttribute.cs
- Header.cs
- BindingSource.cs
- DynamicMetaObject.cs
- IssuedSecurityTokenParameters.cs
- TimeSpanFormat.cs
- SoapHelper.cs
- ListSourceHelper.cs
- FixedSOMFixedBlock.cs
- SoapMessage.cs
- TemplateContent.cs
- TypedServiceOperationListItem.cs
- SpecialNameAttribute.cs
- XPathNodePointer.cs
- IntSecurity.cs
- shaperfactoryquerycachekey.cs
- UntypedNullExpression.cs
- IISUnsafeMethods.cs
- PhysicalOps.cs
- PaperSize.cs
- BevelBitmapEffect.cs
- DotAtomReader.cs
- DelegatedStream.cs
- IDispatchConstantAttribute.cs
- QueryResult.cs
- KnownTypesHelper.cs
- TopClause.cs
- BindingOperations.cs
- DataGridRowEventArgs.cs
- CultureTableRecord.cs
- CodeMemberEvent.cs
- RelationshipEntry.cs
- XpsFilter.cs