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
- ObjectIDGenerator.cs
- XPathEmptyIterator.cs
- DataGridRow.cs
- SystemBrushes.cs
- InputLanguageEventArgs.cs
- CompositeDesignerAccessibleObject.cs
- TheQuery.cs
- XmlEntityReference.cs
- DataGridItem.cs
- HttpApplicationStateWrapper.cs
- Drawing.cs
- SourceFileInfo.cs
- SystemNetworkInterface.cs
- MailSettingsSection.cs
- ContentOperations.cs
- SubMenuStyle.cs
- ConsumerConnectionPointCollection.cs
- regiisutil.cs
- httpserverutility.cs
- InvokeMethodActivityDesigner.cs
- selecteditemcollection.cs
- RSAProtectedConfigurationProvider.cs
- _StreamFramer.cs
- CodeAccessSecurityEngine.cs
- PeerInvitationResponse.cs
- PropertyInfoSet.cs
- ErrorTableItemStyle.cs
- DataServiceHostWrapper.cs
- RuntimeHelpers.cs
- OleDbParameterCollection.cs
- DrawingDrawingContext.cs
- TextServicesCompartment.cs
- PackagingUtilities.cs
- ToolbarAUtomationPeer.cs
- ObjectRef.cs
- XamlRtfConverter.cs
- PeerChannelFactory.cs
- altserialization.cs
- ListViewUpdateEventArgs.cs
- Utils.cs
- WsiProfilesElementCollection.cs
- AppendHelper.cs
- XmlReflectionMember.cs
- SponsorHelper.cs
- ImageBrush.cs
- WebServiceReceive.cs
- _LocalDataStore.cs
- ConnectionOrientedTransportChannelFactory.cs
- OutputCacheSection.cs
- DataContext.cs
- PersonalizablePropertyEntry.cs
- XmlSchemaAll.cs
- CmsInterop.cs
- TextTrailingCharacterEllipsis.cs
- StorageComplexTypeMapping.cs
- MulticastIPAddressInformationCollection.cs
- WorkItem.cs
- RegexNode.cs
- Input.cs
- SafeLocalMemHandle.cs
- SQLByte.cs
- GatewayDefinition.cs
- Soap.cs
- ModelTypeConverter.cs
- TextFormatterHost.cs
- AssertFilter.cs
- SelectionProcessor.cs
- IUnknownConstantAttribute.cs
- InputManager.cs
- ConfigXmlWhitespace.cs
- XmlQueryRuntime.cs
- WebPartCollection.cs
- DataGridViewComboBoxColumn.cs
- GroupQuery.cs
- CacheHelper.cs
- HttpApplicationStateBase.cs
- MessageSmuggler.cs
- DataGridViewImageCell.cs
- ChtmlSelectionListAdapter.cs
- DataComponentGenerator.cs
- EmptyControlCollection.cs
- XmlArrayItemAttributes.cs
- ListMarkerLine.cs
- QilLoop.cs
- CompiledRegexRunner.cs
- SimpleWebHandlerParser.cs
- PartitionResolver.cs
- WSHttpBindingElement.cs
- IdentityHolder.cs
- CodeDelegateCreateExpression.cs
- TypedReference.cs
- Authorization.cs
- TextCharacters.cs
- SortedDictionary.cs
- SoapSchemaImporter.cs
- ToolStripItemGlyph.cs
- RectIndependentAnimationStorage.cs
- ThreadInterruptedException.cs
- WebScriptServiceHostFactory.cs
- DataReceivedEventArgs.cs