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
- SurrogateDataContract.cs
- DriveInfo.cs
- FactoryGenerator.cs
- CheckBox.cs
- KeyTimeConverter.cs
- HashLookup.cs
- ProgressBarHighlightConverter.cs
- ServicePointManagerElement.cs
- OutputChannel.cs
- DbSetClause.cs
- IArgumentProvider.cs
- XmlDataDocument.cs
- Pen.cs
- CheckBoxField.cs
- ProfileSection.cs
- ErrorTolerantObjectWriter.cs
- UTF7Encoding.cs
- VBIdentifierDesigner.xaml.cs
- ImageConverter.cs
- XmlResolver.cs
- Point3DAnimationBase.cs
- MemoryStream.cs
- TreeNodeBinding.cs
- StatusBarItemAutomationPeer.cs
- MappingSource.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- WorkflowOperationAsyncResult.cs
- FtpWebResponse.cs
- TraceSection.cs
- UserPersonalizationStateInfo.cs
- LifetimeServices.cs
- shaper.cs
- GridViewRow.cs
- WebEventCodes.cs
- ManagementEventWatcher.cs
- SafeBitVector32.cs
- Polyline.cs
- ConsoleCancelEventArgs.cs
- WebConfigurationManager.cs
- ApplicationContext.cs
- UInt32Converter.cs
- DataGridViewColumnCollection.cs
- JavaScriptString.cs
- NativeMethods.cs
- MediaCommands.cs
- JavaScriptSerializer.cs
- CodeMemberField.cs
- SystemInfo.cs
- EventManager.cs
- StrongName.cs
- BasicHttpBindingCollectionElement.cs
- BuildManagerHost.cs
- IMembershipProvider.cs
- ProxyWebPart.cs
- HtmlInputCheckBox.cs
- MobileTemplatedControlDesigner.cs
- SamlSubject.cs
- ConnectionInterfaceCollection.cs
- DetailsViewAutoFormat.cs
- UnsafeNativeMethods.cs
- BooleanProjectedSlot.cs
- UpdatePanelTriggerCollection.cs
- XmlResolver.cs
- TransportBindingElementImporter.cs
- SelectedGridItemChangedEvent.cs
- CollectionBuilder.cs
- TreeViewImageKeyConverter.cs
- TextChange.cs
- DPAPIProtectedConfigurationProvider.cs
- HotSpot.cs
- BitmapEffectDrawingContent.cs
- PartBasedPackageProperties.cs
- UInt32Converter.cs
- HttpInputStream.cs
- Selection.cs
- XmlTextAttribute.cs
- TextParentUndoUnit.cs
- SuppressIldasmAttribute.cs
- QueryReaderSettings.cs
- RegistryPermission.cs
- ConfigurationLocationCollection.cs
- FragmentNavigationEventArgs.cs
- XomlSerializationHelpers.cs
- typedescriptorpermissionattribute.cs
- ResetableIterator.cs
- SingleStorage.cs
- RegexWorker.cs
- XmlReflectionImporter.cs
- PhysicalAddress.cs
- XmlSerializerOperationGenerator.cs
- EventSinkHelperWriter.cs
- KerberosSecurityTokenAuthenticator.cs
- Emitter.cs
- InkCanvasInnerCanvas.cs
- DocumentViewer.cs
- DataRecordObjectView.cs
- BmpBitmapEncoder.cs
- ThumbAutomationPeer.cs
- CatalogPartCollection.cs
- Inflater.cs