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
- EntityType.cs
- DrawingServices.cs
- ConfigurationSchemaErrors.cs
- ElementNotAvailableException.cs
- SrgsElementFactory.cs
- SqlEnums.cs
- SqlCharStream.cs
- SecurityResources.cs
- COM2EnumConverter.cs
- StringConverter.cs
- TriggerActionCollection.cs
- InternalCache.cs
- ListViewGroup.cs
- HandlerBase.cs
- RegexStringValidator.cs
- complextypematerializer.cs
- assertwrapper.cs
- OfTypeExpression.cs
- UnmanagedBitmapWrapper.cs
- CmsUtils.cs
- MexNamedPipeBindingElement.cs
- SmtpReplyReaderFactory.cs
- FontFamilyConverter.cs
- UnauthorizedAccessException.cs
- MessageBox.cs
- TypedAsyncResult.cs
- As.cs
- metadatamappinghashervisitor.cs
- SqlXml.cs
- PathSegment.cs
- ArgIterator.cs
- XmlAttributeCollection.cs
- TextRunCacheImp.cs
- BlockUIContainer.cs
- SqlTransaction.cs
- FormsAuthenticationTicket.cs
- ArrayEditor.cs
- RSAPKCS1KeyExchangeFormatter.cs
- CodeCommentStatement.cs
- DoubleLinkList.cs
- SrgsDocument.cs
- PropertyDescriptorCollection.cs
- TypeResolver.cs
- ApplicationGesture.cs
- ComplexBindingPropertiesAttribute.cs
- BaseTemplateCodeDomTreeGenerator.cs
- WpfGeneratedKnownProperties.cs
- FormViewRow.cs
- Expander.cs
- SqlDataSourceQueryEditor.cs
- TextSelectionHighlightLayer.cs
- IndependentlyAnimatedPropertyMetadata.cs
- CodeAttributeDeclarationCollection.cs
- AdornedElementPlaceholder.cs
- System.Data_BID.cs
- EntityKeyElement.cs
- DynamicPhysicalDiscoSearcher.cs
- RecommendedAsConfigurableAttribute.cs
- AsyncInvokeContext.cs
- DoubleCollectionConverter.cs
- versioninfo.cs
- DmlSqlGenerator.cs
- DrawingImage.cs
- InternalSafeNativeMethods.cs
- TypedDataSourceCodeGenerator.cs
- ConfigurationValues.cs
- HttpRequestCacheValidator.cs
- BlurBitmapEffect.cs
- TextSelectionProcessor.cs
- DynamicUpdateCommand.cs
- QilIterator.cs
- SendActivity.cs
- CodeDirectoryCompiler.cs
- ServiceOperationListItemList.cs
- TraceLog.cs
- Utils.cs
- ModuleElement.cs
- PersonalizationStateInfoCollection.cs
- OletxCommittableTransaction.cs
- latinshape.cs
- GC.cs
- UpdatePanel.cs
- HandlerFactoryCache.cs
- CheckBoxList.cs
- NameSpaceEvent.cs
- ListMarkerLine.cs
- RawStylusInput.cs
- PropertyGridView.cs
- TreeBuilderBamlTranslator.cs
- TypeUsageBuilder.cs
- HttpCookie.cs
- DispatcherExceptionEventArgs.cs
- TranslateTransform3D.cs
- Quad.cs
- ConfigXmlElement.cs
- UrlAuthorizationModule.cs
- ContextMenuStrip.cs
- TableAdapterManagerHelper.cs
- BroadcastEventHelper.cs
- PersonalizationAdministration.cs