Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / PageHandlerFactory.cs / 1305376 / 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*/) 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*/) 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
- IndexerNameAttribute.cs
- TdsRecordBufferSetter.cs
- ToolStripMenuItemDesigner.cs
- XsdBuildProvider.cs
- CorrelationTokenInvalidatedHandler.cs
- PromptBuilder.cs
- ConstructorArgumentAttribute.cs
- OdbcErrorCollection.cs
- SetIterators.cs
- SocketElement.cs
- MetaModel.cs
- XmlAttributeCollection.cs
- HashMembershipCondition.cs
- FtpRequestCacheValidator.cs
- EventPropertyMap.cs
- TypeDependencyAttribute.cs
- ItemCollection.cs
- SourceChangedEventArgs.cs
- ManagementOperationWatcher.cs
- WindowsIPAddress.cs
- OdbcTransaction.cs
- MatchSingleFxEngineOpcode.cs
- UserNamePasswordClientCredential.cs
- XmlSchemaResource.cs
- WebEventTraceProvider.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- TypefaceMap.cs
- DispatcherOperation.cs
- DesignerWebPartChrome.cs
- TitleStyle.cs
- TaskFormBase.cs
- RightsManagementInformation.cs
- ExtensionSimplifierMarkupObject.cs
- EntityDataSourceView.cs
- ChtmlSelectionListAdapter.cs
- Vector.cs
- ControlIdConverter.cs
- DataPager.cs
- DrawingDrawingContext.cs
- AuthenticationException.cs
- ManipulationInertiaStartingEventArgs.cs
- Configuration.cs
- UserControlBuildProvider.cs
- LinearGradientBrush.cs
- LinkLabelLinkClickedEvent.cs
- PropertyRef.cs
- XmlSiteMapProvider.cs
- StateManagedCollection.cs
- GridSplitterAutomationPeer.cs
- PartitionedStreamMerger.cs
- InkCanvasFeedbackAdorner.cs
- DataGridHeaderBorder.cs
- QilInvokeLateBound.cs
- Matrix3DValueSerializer.cs
- HtmlHead.cs
- EditorZoneBase.cs
- View.cs
- CustomLineCap.cs
- DataGridLinkButton.cs
- TypeUtil.cs
- AuthenticationManager.cs
- mediaeventshelper.cs
- ColumnReorderedEventArgs.cs
- ClientRoleProvider.cs
- CharacterMetricsDictionary.cs
- ObfuscationAttribute.cs
- Sequence.cs
- IPHostEntry.cs
- SymmetricKey.cs
- PageAsyncTaskManager.cs
- LinkedResourceCollection.cs
- HttpPostedFile.cs
- XmlSchemaObjectCollection.cs
- Panel.cs
- Directory.cs
- WorkflowViewService.cs
- BoolExpressionVisitors.cs
- MyContact.cs
- SelectionList.cs
- FrameworkReadOnlyPropertyMetadata.cs
- _SslStream.cs
- _FixedSizeReader.cs
- InvalidDataException.cs
- ConfigurationLocation.cs
- xml.cs
- LogEntryDeserializer.cs
- GuidConverter.cs
- SafeProcessHandle.cs
- DataPointer.cs
- SizeConverter.cs
- OutputCacheSettingsSection.cs
- WebPartMenuStyle.cs
- BuildManager.cs
- TerminatorSinks.cs
- ReceiveActivity.cs
- BaseTemplateCodeDomTreeGenerator.cs
- SafeLibraryHandle.cs
- DigitalSignatureProvider.cs
- Focus.cs
- SQLByte.cs