Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- StateDesigner.TransitionInfo.cs
- XPathScanner.cs
- Brushes.cs
- XslNumber.cs
- SecurityChannelFactory.cs
- HttpCapabilitiesBase.cs
- securestring.cs
- TableParaClient.cs
- ConversionContext.cs
- NamespaceListProperty.cs
- ToolStripRendererSwitcher.cs
- UTF8Encoding.cs
- MenuScrollingVisibilityConverter.cs
- LostFocusEventManager.cs
- SqlBulkCopy.cs
- SerialErrors.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- BasicBrowserDialog.designer.cs
- ConfigurationManagerHelper.cs
- TextPatternIdentifiers.cs
- Baml2006SchemaContext.cs
- SystemWebSectionGroup.cs
- TextModifier.cs
- HwndKeyboardInputProvider.cs
- ExtendedProperty.cs
- MimeXmlImporter.cs
- EntityDataSourceState.cs
- LambdaCompiler.Address.cs
- FastPropertyAccessor.cs
- PenThreadWorker.cs
- BitStack.cs
- BinaryObjectReader.cs
- SmiContext.cs
- CollectionTypeElement.cs
- FastEncoder.cs
- DoubleLinkListEnumerator.cs
- HttpRawResponse.cs
- TextEditorDragDrop.cs
- SequentialWorkflowHeaderFooter.cs
- SynchronizedInputPattern.cs
- SafeRegistryHandle.cs
- SamlAction.cs
- ReleaseInstanceMode.cs
- HitTestParameters.cs
- DesignerForm.cs
- EventLogPermissionHolder.cs
- Activator.cs
- PriorityChain.cs
- FocusManager.cs
- GeneralTransform3DCollection.cs
- SqlMultiplexer.cs
- AutoGeneratedField.cs
- BufferAllocator.cs
- SafeLocalMemHandle.cs
- CommonProperties.cs
- AssociativeAggregationOperator.cs
- Application.cs
- CommandLibraryHelper.cs
- SqlBulkCopyColumnMappingCollection.cs
- NetworkStream.cs
- DataGridCell.cs
- Solver.cs
- HttpModuleAction.cs
- HttpProcessUtility.cs
- UIElementCollection.cs
- HtmlGenericControl.cs
- TableProviderWrapper.cs
- CodeCatchClauseCollection.cs
- SortedDictionary.cs
- XmlSchemaExternal.cs
- ParseChildrenAsPropertiesAttribute.cs
- TableTextElementCollectionInternal.cs
- ADMembershipProvider.cs
- UInt16.cs
- HtmlHead.cs
- documentsequencetextpointer.cs
- TransactionTraceIdentifier.cs
- FormViewUpdatedEventArgs.cs
- AppSecurityManager.cs
- SqlSelectStatement.cs
- Matrix3DStack.cs
- TextEndOfParagraph.cs
- Models.cs
- LineSegment.cs
- LazyTextWriterCreator.cs
- NamedObject.cs
- AnnotationResource.cs
- ProfileEventArgs.cs
- PartialTrustVisibleAssemblyCollection.cs
- VisualTreeUtils.cs
- MLangCodePageEncoding.cs
- SafeCryptHandles.cs
- X509ChainPolicy.cs
- Accessors.cs
- InvalidChannelBindingException.cs
- ProfileParameter.cs
- CacheModeConverter.cs
- TextTreeText.cs
- DataListItemEventArgs.cs
- ParameterCollection.cs