Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / PageHandlerFactory.cs / 3 / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- columnmapfactory.cs
- SspiSafeHandles.cs
- TextCompositionManager.cs
- SynchronizationLockException.cs
- ObjectPersistData.cs
- DataGridViewTopLeftHeaderCell.cs
- GenericWebPart.cs
- ChannelServices.cs
- Imaging.cs
- ZipIOExtraFieldPaddingElement.cs
- PageParser.cs
- OleDbDataAdapter.cs
- RijndaelManaged.cs
- EmbeddedMailObjectsCollection.cs
- RangeValidator.cs
- ParameterToken.cs
- ListViewTableCell.cs
- TargetInvocationException.cs
- MonthChangedEventArgs.cs
- XmlAttributeProperties.cs
- TabPanel.cs
- WeakEventTable.cs
- TemplateXamlTreeBuilder.cs
- SiteMembershipCondition.cs
- DataGridViewImageCell.cs
- Label.cs
- Visitor.cs
- SqlDataSourceEnumerator.cs
- TableLayoutSettings.cs
- SettingsProperty.cs
- Typeface.cs
- StringReader.cs
- MailBnfHelper.cs
- SqlTrackingService.cs
- CompositeControl.cs
- ProfileBuildProvider.cs
- MdiWindowListStrip.cs
- AffineTransform3D.cs
- StyleCollection.cs
- DataObjectEventArgs.cs
- ConfigurationManagerHelper.cs
- InkCanvasSelectionAdorner.cs
- SHA384.cs
- SharedStatics.cs
- XmlStreamStore.cs
- TextEffectResolver.cs
- Workspace.cs
- TypeExtension.cs
- PointHitTestParameters.cs
- DescendantOverDescendantQuery.cs
- PartialList.cs
- SqlSelectStatement.cs
- OutKeywords.cs
- BitmapEffectGroup.cs
- ToolStripTextBox.cs
- Point3DConverter.cs
- DrawingAttributesDefaultValueFactory.cs
- Command.cs
- WindowsSolidBrush.cs
- GroupBoxRenderer.cs
- _ScatterGatherBuffers.cs
- AssemblyAssociatedContentFileAttribute.cs
- Style.cs
- DashStyle.cs
- Avt.cs
- MetadataUtilsSmi.cs
- JobPageOrder.cs
- XmlFormatReaderGenerator.cs
- Rotation3D.cs
- IODescriptionAttribute.cs
- NetworkCredential.cs
- AdvancedBindingPropertyDescriptor.cs
- Inflater.cs
- InputDevice.cs
- OracleConnectionString.cs
- ResourceManager.cs
- BindingGraph.cs
- PropertyEmitterBase.cs
- CodeDefaultValueExpression.cs
- ViewCellSlot.cs
- StringInfo.cs
- ServiceModelActivationSectionGroup.cs
- DesignSurfaceServiceContainer.cs
- MetadataSerializer.cs
- WebBrowser.cs
- TextDecorationUnitValidation.cs
- InkSerializer.cs
- FileSystemInfo.cs
- TableRowGroup.cs
- MessageQueueInstaller.cs
- EntityDataSourceWrapperCollection.cs
- TextContainerChangedEventArgs.cs
- MonitoringDescriptionAttribute.cs
- MsdtcClusterUtils.cs
- ProviderConnectionPointCollection.cs
- CharacterBuffer.cs
- BackgroundWorker.cs
- Cloud.cs
- NameHandler.cs
- GuidConverter.cs