Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BindingCollection.cs
- RefExpr.cs
- ConsumerConnectionPoint.cs
- _ListenerRequestStream.cs
- ScrollableControl.cs
- LoginDesignerUtil.cs
- Button.cs
- TableSectionStyle.cs
- SpotLight.cs
- GroupBoxAutomationPeer.cs
- BrowserTree.cs
- DllNotFoundException.cs
- _OSSOCK.cs
- ReverseInheritProperty.cs
- SafeCryptHandles.cs
- XamlReader.cs
- TemplateBindingExtensionConverter.cs
- TemplateKey.cs
- ComplexTypeEmitter.cs
- CheckPair.cs
- AttributeCollection.cs
- XmlEncodedRawTextWriter.cs
- OdbcConnectionPoolProviderInfo.cs
- BuilderPropertyEntry.cs
- TableLayoutCellPaintEventArgs.cs
- TablePattern.cs
- ListSortDescriptionCollection.cs
- NoClickablePointException.cs
- Compiler.cs
- ListItemCollection.cs
- TreeIterator.cs
- MediaSystem.cs
- BasicExpandProvider.cs
- X509AsymmetricSecurityKey.cs
- ComponentChangedEvent.cs
- FormatConvertedBitmap.cs
- OleDbSchemaGuid.cs
- QueryContinueDragEventArgs.cs
- NativeMethods.cs
- WebProxyScriptElement.cs
- EventArgs.cs
- FormViewInsertEventArgs.cs
- TabControlDesigner.cs
- Repeater.cs
- BasicHttpMessageSecurity.cs
- IImplicitResourceProvider.cs
- ToolStripTextBox.cs
- PrintPageEvent.cs
- TemplateBindingExpressionConverter.cs
- ColorBuilder.cs
- MetadataItem.cs
- ReferenceEqualityComparer.cs
- TrustManager.cs
- SamlAssertion.cs
- ContentValidator.cs
- URLEditor.cs
- XmlSequenceWriter.cs
- DataGridComboBoxColumn.cs
- MediaPlayerState.cs
- ElapsedEventArgs.cs
- FirstQueryOperator.cs
- XPathDocumentBuilder.cs
- TextCharacters.cs
- AutomationElementIdentifiers.cs
- NominalTypeEliminator.cs
- PropertyTabAttribute.cs
- FixedSOMLineCollection.cs
- WebHttpSecurity.cs
- _SafeNetHandles.cs
- recordstatefactory.cs
- MethodRental.cs
- CommunicationException.cs
- GlyphCache.cs
- ColumnMapTranslator.cs
- MediaTimeline.cs
- ApplicationFileParser.cs
- BaseHashHelper.cs
- StringExpressionSet.cs
- TableProvider.cs
- OutputCacheSettings.cs
- SQlBooleanStorage.cs
- CardSpaceSelector.cs
- _NegoStream.cs
- HTTPNotFoundHandler.cs
- ImageCodecInfoPrivate.cs
- PreservationFileWriter.cs
- DBNull.cs
- RuleProcessor.cs
- columnmapkeybuilder.cs
- TagPrefixInfo.cs
- Setter.cs
- CodeParameterDeclarationExpressionCollection.cs
- SamlAdvice.cs
- ItemContainerProviderWrapper.cs
- KeyConstraint.cs
- EntitySetBaseCollection.cs
- MatrixStack.cs
- HttpRawResponse.cs
- FilterElement.cs
- RC2.cs