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
- PropertyGroupDescription.cs
- RegexStringValidatorAttribute.cs
- CollectionViewProxy.cs
- Events.cs
- ApplicationSettingsBase.cs
- SqlUdtInfo.cs
- ToolBarPanel.cs
- Exception.cs
- ResourcePool.cs
- TimelineGroup.cs
- CodeNamespaceCollection.cs
- TableLayoutStyle.cs
- HttpContext.cs
- SettingsPropertyIsReadOnlyException.cs
- AccessText.cs
- TypeInfo.cs
- FontStyleConverter.cs
- NamedPermissionSet.cs
- PasswordDeriveBytes.cs
- XmlTypeMapping.cs
- ContainerVisual.cs
- DataControlField.cs
- RC2CryptoServiceProvider.cs
- BinaryReader.cs
- TimestampInformation.cs
- SafeNativeMemoryHandle.cs
- PageThemeCodeDomTreeGenerator.cs
- WaitHandleCannotBeOpenedException.cs
- KeyFrames.cs
- Activity.cs
- LiteralControl.cs
- ObjectRef.cs
- MatcherBuilder.cs
- TableStyle.cs
- EmptyEnumerable.cs
- XmlAttributes.cs
- WebServiceMethodData.cs
- GPRECT.cs
- MessageBuilder.cs
- SQLConvert.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- RewritingSimplifier.cs
- XsltSettings.cs
- EqualityComparer.cs
- URLIdentityPermission.cs
- ActivityAction.cs
- StructuredProperty.cs
- TextProviderWrapper.cs
- ConvertersCollection.cs
- DiagnosticsConfiguration.cs
- CodeSnippetTypeMember.cs
- FontFaceLayoutInfo.cs
- XmlHierarchyData.cs
- Style.cs
- SystemInfo.cs
- XmlSchemaSimpleTypeList.cs
- ListControl.cs
- TraceData.cs
- __Filters.cs
- CircleEase.cs
- LinqToSqlWrapper.cs
- DrawItemEvent.cs
- ExtenderProvidedPropertyAttribute.cs
- SqlNotificationRequest.cs
- SchemaTypeEmitter.cs
- ImportDesigner.xaml.cs
- FilterableAttribute.cs
- ObjectListGeneralPage.cs
- GenericEnumConverter.cs
- DependencyProperty.cs
- SpanIndex.cs
- DispatcherExceptionFilterEventArgs.cs
- ViewManager.cs
- ColumnResizeUndoUnit.cs
- MetafileHeader.cs
- SoapMessage.cs
- VisualStyleInformation.cs
- ToolStripItemCollection.cs
- COAUTHINFO.cs
- AssociationSetMetadata.cs
- GlobalizationSection.cs
- EntityProxyFactory.cs
- ToolTipService.cs
- ResourceProviderFactory.cs
- DrawingServices.cs
- ScrollViewerAutomationPeer.cs
- ScaleTransform.cs
- MasterPageBuildProvider.cs
- TreeNodeEventArgs.cs
- DBConnection.cs
- XmlSchemaFacet.cs
- UserPersonalizationStateInfo.cs
- ITextView.cs
- BuildProvider.cs
- FormView.cs
- RC2.cs
- EntityDataSourceColumn.cs
- Merger.cs
- WinHttpWebProxyFinder.cs
- Pool.cs