Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / PageHandlerFactory.cs / 2 / 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; } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ListViewItemSelectionChangedEvent.cs
- SiteMapSection.cs
- SQLRoleProvider.cs
- Int16AnimationBase.cs
- MarkedHighlightComponent.cs
- DateTimeFormatInfoScanner.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- ISFTagAndGuidCache.cs
- ObjectContextServiceProvider.cs
- XDeferredAxisSource.cs
- SequenceFullException.cs
- TaskScheduler.cs
- ApplicationDirectory.cs
- DeploymentExceptionMapper.cs
- ServiceOperationInfoTypeConverter.cs
- TreeNodeConverter.cs
- RowTypeElement.cs
- CanExecuteRoutedEventArgs.cs
- TabItemAutomationPeer.cs
- StringAnimationUsingKeyFrames.cs
- ItemList.cs
- EntityDesignerBuildProvider.cs
- XmlWrappingReader.cs
- CollectionViewGroup.cs
- Span.cs
- ControlBindingsCollection.cs
- EnumMemberAttribute.cs
- TransformDescriptor.cs
- XmlCompatibilityReader.cs
- ContextDataSourceContextData.cs
- ClickablePoint.cs
- ThreadStartException.cs
- XmlSchemaProviderAttribute.cs
- MissingMemberException.cs
- ImageSource.cs
- EndpointDispatcher.cs
- NamespaceEmitter.cs
- Int32Collection.cs
- Form.cs
- PasswordRecovery.cs
- GPRECT.cs
- DataGridViewButtonColumn.cs
- _SSPIWrapper.cs
- PnrpPermission.cs
- _LocalDataStoreMgr.cs
- hresults.cs
- ObjectDataSourceMethodEventArgs.cs
- DataGridColumn.cs
- ParameterBuilder.cs
- TraceUtility.cs
- LambdaCompiler.cs
- TailCallAnalyzer.cs
- BinaryParser.cs
- Win32.cs
- uribuilder.cs
- Message.cs
- ContainerFilterService.cs
- AmbientLight.cs
- InfoCardMasterKey.cs
- QilXmlReader.cs
- BamlRecordReader.cs
- TileModeValidation.cs
- CfgParser.cs
- WebServiceTypeData.cs
- DeploymentSection.cs
- EdmValidator.cs
- OdbcConnectionPoolProviderInfo.cs
- NavigationPropertyEmitter.cs
- RichTextBoxConstants.cs
- InkCanvasSelectionAdorner.cs
- DataGridViewCellStyleConverter.cs
- OptimalTextSource.cs
- TrustSection.cs
- FixedSOMTableCell.cs
- System.Data.OracleClient_BID.cs
- MultidimensionalArrayItemReference.cs
- RequestCachingSection.cs
- SchemaImporter.cs
- JsonReaderWriterFactory.cs
- StatusBarAutomationPeer.cs
- PostBackTrigger.cs
- StronglyTypedResourceBuilder.cs
- ViewCellSlot.cs
- UserControlAutomationPeer.cs
- Ops.cs
- _ListenerRequestStream.cs
- BaseResourcesBuildProvider.cs
- XPathDocumentNavigator.cs
- WebExceptionStatus.cs
- UnsafeMethods.cs
- IntSecurity.cs
- TableLayoutPanelCellPosition.cs
- MouseGestureValueSerializer.cs
- ISAPIRuntime.cs
- BrowserDefinitionCollection.cs
- ApplicationServiceManager.cs
- DictionarySectionHandler.cs
- PostBackOptions.cs
- ReadOnlyMetadataCollection.cs
- ListViewItemCollectionEditor.cs