Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / PageHandlerFactory.cs / 1305376 / 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*/) 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*/) 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
- HtmlButton.cs
- PersonalizableAttribute.cs
- WsdlImporter.cs
- TraceHandler.cs
- Char.cs
- ColorTransform.cs
- OpenFileDialog.cs
- ClientEventManager.cs
- DataGridViewAdvancedBorderStyle.cs
- ReadOnlyTernaryTree.cs
- IndexingContentUnit.cs
- TypeDelegator.cs
- UriTemplateTableMatchCandidate.cs
- PersonalizationStateQuery.cs
- ConnectionsZone.cs
- WebPartCatalogCloseVerb.cs
- XmlCharCheckingReader.cs
- WindowsRebar.cs
- DoubleLinkListEnumerator.cs
- ProgressBarHighlightConverter.cs
- Executor.cs
- EventLogger.cs
- XmlSchemaIdentityConstraint.cs
- PropertyMetadata.cs
- Transaction.cs
- ServiceDescription.cs
- _LocalDataStoreMgr.cs
- MyContact.cs
- LightweightCodeGenerator.cs
- ItemDragEvent.cs
- IndexedSelectQueryOperator.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- DataBoundLiteralControl.cs
- SelectionPattern.cs
- HttpTransportElement.cs
- TextTreeNode.cs
- ToolboxItemAttribute.cs
- DetailsViewDeleteEventArgs.cs
- PropertyRef.cs
- AttachedPropertyBrowsableAttribute.cs
- AppDomainUnloadedException.cs
- TTSEvent.cs
- XslCompiledTransform.cs
- Icon.cs
- XmlObjectSerializerWriteContext.cs
- Selection.cs
- Hashtable.cs
- DisplayNameAttribute.cs
- IdentityHolder.cs
- ToolboxItemAttribute.cs
- DefaultValidator.cs
- SafeFileMappingHandle.cs
- CompiledRegexRunnerFactory.cs
- IntPtr.cs
- MultiBinding.cs
- Timer.cs
- PathFigureCollection.cs
- WindowsGraphics.cs
- ArrayTypeMismatchException.cs
- StrongNameMembershipCondition.cs
- XmlHierarchyData.cs
- _OSSOCK.cs
- CompensateDesigner.cs
- PersonalizationStateInfo.cs
- HtmlElementCollection.cs
- ValueTable.cs
- Configuration.cs
- LinkUtilities.cs
- ClientRoleProvider.cs
- FieldTemplateUserControl.cs
- X509CertificateChain.cs
- DataBindingList.cs
- WebServiceResponse.cs
- TypeReference.cs
- JsonSerializer.cs
- WebBrowserContainer.cs
- UnknownBitmapEncoder.cs
- PolyBezierSegment.cs
- RequestSecurityTokenResponse.cs
- SQLDateTimeStorage.cs
- EvidenceTypeDescriptor.cs
- BindingBase.cs
- ViewGenerator.cs
- TableLayoutSettings.cs
- FilterException.cs
- EdmType.cs
- MemberDomainMap.cs
- NavigateEvent.cs
- SqlBuilder.cs
- CodeTypeDeclarationCollection.cs
- ReflectTypeDescriptionProvider.cs
- ProfilePropertySettings.cs
- ExpandCollapseProviderWrapper.cs
- PipelineComponent.cs
- XmlSchemaProviderAttribute.cs
- ColumnClickEvent.cs
- ConfigurationElementProperty.cs
- CodeAccessPermission.cs
- XmlCompatibilityReader.cs
- HttpConfigurationContext.cs