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
- HttpProcessUtility.cs
- ByeMessage11.cs
- DataSourceIDConverter.cs
- MaskedTextProvider.cs
- TextTreeObjectNode.cs
- CodeThrowExceptionStatement.cs
- MissingMemberException.cs
- EtwTrace.cs
- shaperfactory.cs
- TcpChannelHelper.cs
- DocumentApplication.cs
- AnimationClock.cs
- MetadataWorkspace.cs
- SqlClientFactory.cs
- ThousandthOfEmRealDoubles.cs
- RenderOptions.cs
- AsyncDataRequest.cs
- EventMappingSettingsCollection.cs
- CookieProtection.cs
- DataGridViewLayoutData.cs
- AutoResetEvent.cs
- PropertyMetadata.cs
- ExpressionCopier.cs
- MeshGeometry3D.cs
- WebPartEditorApplyVerb.cs
- CultureInfo.cs
- ProcessInfo.cs
- XmlWrappingWriter.cs
- WeakEventManager.cs
- Style.cs
- DesignerVerb.cs
- RuleSettings.cs
- VoiceInfo.cs
- LookupNode.cs
- WorkflowInstanceProvider.cs
- DateTimeAutomationPeer.cs
- WindowInteractionStateTracker.cs
- PersonalizationState.cs
- DataGridLinkButton.cs
- FastPropertyAccessor.cs
- PageThemeCodeDomTreeGenerator.cs
- PagesChangedEventArgs.cs
- Bezier.cs
- CollectionDataContract.cs
- BinaryNode.cs
- RemoteWebConfigurationHost.cs
- Encoding.cs
- FileDialogPermission.cs
- ByteConverter.cs
- DbDataReader.cs
- XmlSchemaSequence.cs
- ContextProperty.cs
- HttpValueCollection.cs
- SiteMembershipCondition.cs
- _StreamFramer.cs
- Stroke2.cs
- EditorPart.cs
- CompiledQueryCacheEntry.cs
- IdentifierService.cs
- ADMembershipProvider.cs
- TraceHandlerErrorFormatter.cs
- SiteMapNodeItem.cs
- WebPartCloseVerb.cs
- TextRunTypographyProperties.cs
- ContentHostHelper.cs
- SqlDataSourceStatusEventArgs.cs
- Dictionary.cs
- VariableQuery.cs
- UTF8Encoding.cs
- WebPartZone.cs
- MultitargetUtil.cs
- DnsPermission.cs
- arabicshape.cs
- StateWorkerRequest.cs
- UrlMappingCollection.cs
- GridItemProviderWrapper.cs
- WebPartConnectionsConnectVerb.cs
- HuffCodec.cs
- HelpExampleGenerator.cs
- AbstractDataSvcMapFileLoader.cs
- FixedSOMImage.cs
- XmlSchemaSimpleContentExtension.cs
- EventHandlersStore.cs
- DeclarativeCatalogPart.cs
- ChannelManager.cs
- ServiceBuildProvider.cs
- SqlRowUpdatedEvent.cs
- SEHException.cs
- XmlIlTypeHelper.cs
- XmlNodeReader.cs
- InitiatorServiceModelSecurityTokenRequirement.cs
- SafeFileHandle.cs
- UTF7Encoding.cs
- SortedList.cs
- TextLineResult.cs
- StrongTypingException.cs
- MappingException.cs
- VoiceChangeEventArgs.cs
- PageBuildProvider.cs
- RepeaterItemCollection.cs