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
- ServerTooBusyException.cs
- ApplicationFileCodeDomTreeGenerator.cs
- BeginEvent.cs
- LookupTables.cs
- IxmlLineInfo.cs
- ShaderRenderModeValidation.cs
- RTTrackingProfile.cs
- XmlMembersMapping.cs
- Collection.cs
- FileClassifier.cs
- ConnectionManager.cs
- ActivityIdHeader.cs
- KeyTime.cs
- MetadataItemSerializer.cs
- SecurityBindingElement.cs
- FragmentNavigationEventArgs.cs
- LicFileLicenseProvider.cs
- SafeProcessHandle.cs
- SplitContainer.cs
- TdsValueSetter.cs
- PreloadedPackages.cs
- ChildDocumentBlock.cs
- ClientUtils.cs
- PowerEase.cs
- PathStreamGeometryContext.cs
- ExportOptions.cs
- AxisAngleRotation3D.cs
- SelectManyQueryOperator.cs
- DbConnectionPool.cs
- GenericAuthenticationEventArgs.cs
- QuestionEventArgs.cs
- SimpleHandlerFactory.cs
- MembershipValidatePasswordEventArgs.cs
- ObjectDataSourceDisposingEventArgs.cs
- XmlSchemaComplexType.cs
- dataprotectionpermission.cs
- XsdDateTime.cs
- EdgeModeValidation.cs
- SiteMapNodeItem.cs
- ToolBar.cs
- StackSpiller.cs
- MenuCommands.cs
- RuntimeConfigLKG.cs
- ConfigurationElementProperty.cs
- iisPickupDirectory.cs
- MethodCallExpression.cs
- ZipIOModeEnforcingStream.cs
- InvalidCastException.cs
- SystemNetworkInterface.cs
- Selector.cs
- AtomContentProperty.cs
- SrgsElementFactory.cs
- Propagator.JoinPropagator.cs
- ListViewItem.cs
- ChannelManager.cs
- DesignerForm.cs
- ReadOnlyKeyedCollection.cs
- Math.cs
- BulletChrome.cs
- ColumnReorderedEventArgs.cs
- InputMethod.cs
- ToolStripDesignerAvailabilityAttribute.cs
- DataPagerField.cs
- ObjectDataProvider.cs
- ScaleTransform3D.cs
- CompositeFontInfo.cs
- SqlWriter.cs
- DynamicField.cs
- ICspAsymmetricAlgorithm.cs
- BufferModeSettings.cs
- EditorZone.cs
- TransactedBatchingBehavior.cs
- SortedList.cs
- PointConverter.cs
- PrinterResolution.cs
- EditingMode.cs
- ConfigXmlElement.cs
- tibetanshape.cs
- OleDbConnectionInternal.cs
- ArgumentDesigner.xaml.cs
- Selector.cs
- RowParagraph.cs
- DesignerOptions.cs
- MultiAsyncResult.cs
- XLinq.cs
- SetterBase.cs
- ObjectMemberMapping.cs
- HeaderElement.cs
- XmlQueryStaticData.cs
- LoginCancelEventArgs.cs
- Stylus.cs
- IPAddressCollection.cs
- WebPartTransformerCollection.cs
- SupportingTokenProviderSpecification.cs
- GenericUriParser.cs
- PanelDesigner.cs
- SQLDouble.cs
- XmlQueryType.cs
- SortFieldComparer.cs
- FormatterConverter.cs