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
- ErrorWrapper.cs
- OleCmdHelper.cs
- SiteMapSection.cs
- LicenseManager.cs
- WebSysDescriptionAttribute.cs
- PerspectiveCamera.cs
- UntrustedRecipientException.cs
- ProfilePropertySettings.cs
- OrderByQueryOptionExpression.cs
- PriorityChain.cs
- ParameterExpression.cs
- IsolatedStorageFileStream.cs
- ColumnHeaderConverter.cs
- TemplateInstanceAttribute.cs
- ApplicationTrust.cs
- SafeEventLogWriteHandle.cs
- MdiWindowListStrip.cs
- SymmetricAlgorithm.cs
- ConstructorExpr.cs
- NamespaceExpr.cs
- PropertyGeneratedEventArgs.cs
- CatalogPart.cs
- RoleGroupCollection.cs
- LocalBuilder.cs
- DependencyStoreSurrogate.cs
- HttpResponseHeader.cs
- MulticastNotSupportedException.cs
- SamlEvidence.cs
- KnowledgeBase.cs
- DynamicValueConverter.cs
- HttpServerUtilityWrapper.cs
- CodeIdentifier.cs
- RemotingSurrogateSelector.cs
- UIntPtr.cs
- DependencyPropertyKey.cs
- AuthenticatingEventArgs.cs
- HelpHtmlBuilder.cs
- DCSafeHandle.cs
- AtomParser.cs
- HostingPreferredMapPath.cs
- _AutoWebProxyScriptWrapper.cs
- CryptoHelper.cs
- SystemColors.cs
- ServiceDurableInstance.cs
- SqlProfileProvider.cs
- AssemblyInfo.cs
- OleDbErrorCollection.cs
- DesignParameter.cs
- HitTestResult.cs
- RectangleGeometry.cs
- BitmapDownload.cs
- GeometryCollection.cs
- CodeConditionStatement.cs
- ObjectQueryState.cs
- CodeNamespaceImport.cs
- DocumentViewerConstants.cs
- HttpAsyncResult.cs
- Currency.cs
- SizeConverter.cs
- HMACSHA1.cs
- DocumentViewer.cs
- AsyncDataRequest.cs
- SplineQuaternionKeyFrame.cs
- HtmlGenericControl.cs
- SafeBitVector32.cs
- Matrix.cs
- DiscoveryDocumentLinksPattern.cs
- Typeface.cs
- Int16Storage.cs
- ProcessInfo.cs
- AllowedAudienceUriElement.cs
- CompilationRelaxations.cs
- WebPartVerbCollection.cs
- MyContact.cs
- TranslateTransform3D.cs
- VarInfo.cs
- InputGestureCollection.cs
- ButtonBaseAutomationPeer.cs
- HttpsHostedTransportConfiguration.cs
- SmiEventSink.cs
- FontFamilyConverter.cs
- EdmType.cs
- XmlSchemaDatatype.cs
- WebEventCodes.cs
- CodeMethodReturnStatement.cs
- Typeface.cs
- DocumentPageViewAutomationPeer.cs
- AppDomainManager.cs
- DeferrableContentConverter.cs
- SystemThemeKey.cs
- SmiConnection.cs
- httpstaticobjectscollection.cs
- ControlPropertyNameConverter.cs
- PlaceHolder.cs
- StylusPointPropertyInfoDefaults.cs
- RadialGradientBrush.cs
- PointValueSerializer.cs
- ResourceSet.cs
- DropDownButton.cs
- EntityDataSourceReferenceGroup.cs