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
- BitmapFrameDecode.cs
- BufferedGraphics.cs
- BinarySerializer.cs
- CollectionConverter.cs
- IconConverter.cs
- MessageBox.cs
- ConfigurationManagerHelper.cs
- Int32AnimationBase.cs
- SurrogateEncoder.cs
- SourceSwitch.cs
- SafeEventLogReadHandle.cs
- SafeRightsManagementPubHandle.cs
- XmlSchemaAnnotated.cs
- GiveFeedbackEventArgs.cs
- EncoderExceptionFallback.cs
- MenuItemBinding.cs
- HttpCookieCollection.cs
- DispatchRuntime.cs
- InterleavedZipPartStream.cs
- SafeFindHandle.cs
- HandlerWithFactory.cs
- ConditionalWeakTable.cs
- XmlBindingWorker.cs
- GridViewUpdatedEventArgs.cs
- Fonts.cs
- DEREncoding.cs
- SeverityFilter.cs
- RandomNumberGenerator.cs
- WebAdminConfigurationHelper.cs
- DoubleCollectionConverter.cs
- SymLanguageVendor.cs
- LocatorPartList.cs
- UInt32Converter.cs
- DebuggerService.cs
- CoTaskMemHandle.cs
- ZipFileInfoCollection.cs
- Annotation.cs
- DocumentPageViewAutomationPeer.cs
- XmlSchemaRedefine.cs
- BamlLocalizer.cs
- DelegateInArgument.cs
- MachineSettingsSection.cs
- BinaryKeyIdentifierClause.cs
- DetailsViewUpdateEventArgs.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- DbConvert.cs
- SendingRequestEventArgs.cs
- GridViewColumnCollectionChangedEventArgs.cs
- Rotation3D.cs
- StandardTransformFactory.cs
- CodeEventReferenceExpression.cs
- MsmqAuthenticationMode.cs
- Certificate.cs
- Crc32Helper.cs
- PropertyKey.cs
- BamlTreeNode.cs
- EditModeSwitchButton.cs
- mediapermission.cs
- ReservationCollection.cs
- DashStyle.cs
- CommonDialog.cs
- PeerTransportSecuritySettings.cs
- AspNetRouteServiceHttpHandler.cs
- TypeNameHelper.cs
- XmlWrappingReader.cs
- DbConnectionPool.cs
- MemberAccessException.cs
- PropertyChangingEventArgs.cs
- TextTreeFixupNode.cs
- PropertyGrid.cs
- BaseCodeDomTreeGenerator.cs
- HttpSessionStateWrapper.cs
- cookiecollection.cs
- CellRelation.cs
- Point4DConverter.cs
- HtmlGenericControl.cs
- ScrollChrome.cs
- ListParaClient.cs
- PreservationFileReader.cs
- SignedXml.cs
- FixedStringLookup.cs
- ConfigurationElement.cs
- StylusPointProperties.cs
- PropertyEmitterBase.cs
- AdapterUtil.cs
- TransactionProtocol.cs
- ExceptionDetail.cs
- CommandEventArgs.cs
- LinqDataSourceUpdateEventArgs.cs
- TreeWalkHelper.cs
- CodeSubDirectory.cs
- InvalidWorkflowException.cs
- BuildDependencySet.cs
- wgx_render.cs
- AddInContractAttribute.cs
- Vector3DConverter.cs
- elementinformation.cs
- X509AsymmetricSecurityKey.cs
- ColorKeyFrameCollection.cs
- MarkupWriter.cs