Code:
/ FX-1434 / FX-1434 / 1.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
- WebPartConnectionsConnectVerb.cs
- DbMetaDataColumnNames.cs
- SingleStorage.cs
- DesignerDataStoredProcedure.cs
- GroupLabel.cs
- HandlerMappingMemo.cs
- HandledEventArgs.cs
- XpsFontSubsetter.cs
- SafeLibraryHandle.cs
- QueryStatement.cs
- AsyncOperationManager.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- StateManagedCollection.cs
- WindowsContainer.cs
- FlowDecisionDesigner.xaml.cs
- ConfigurationException.cs
- ObjectDataSourceDisposingEventArgs.cs
- FeatureAttribute.cs
- PolyLineSegment.cs
- AttachInfo.cs
- DataGridTextBox.cs
- MailAddressCollection.cs
- WindowsListViewScroll.cs
- CmsInterop.cs
- TextBlockAutomationPeer.cs
- SignedXml.cs
- WebPartVerb.cs
- MILUtilities.cs
- SharedStatics.cs
- SHA256Managed.cs
- DictionaryManager.cs
- UserControlCodeDomTreeGenerator.cs
- ExplicitDiscriminatorMap.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- BamlLocalizer.cs
- MatrixAnimationUsingPath.cs
- LinkDesigner.cs
- ActionItem.cs
- ByteKeyFrameCollection.cs
- MenuStrip.cs
- SqlTopReducer.cs
- WebEvents.cs
- ContextQuery.cs
- UnhandledExceptionEventArgs.cs
- brushes.cs
- COM2PropertyBuilderUITypeEditor.cs
- WebPartsPersonalizationAuthorization.cs
- ValidationErrorCollection.cs
- UIElement.cs
- SByteStorage.cs
- DescendentsWalker.cs
- UpdatePanel.cs
- ControlAdapter.cs
- DataGridViewRowsRemovedEventArgs.cs
- TraceSection.cs
- KeyConverter.cs
- FormViewModeEventArgs.cs
- WindowHideOrCloseTracker.cs
- DeviceSpecificDialogCachedState.cs
- UnsafeNativeMethods.cs
- SiteMapSection.cs
- ClientScriptItem.cs
- XmlDigitalSignatureProcessor.cs
- SystemIPGlobalProperties.cs
- ActivityExecutionFilter.cs
- SqlDependencyUtils.cs
- OutputCacheSettings.cs
- PipelineDeploymentState.cs
- TraceSwitch.cs
- ScrollItemPattern.cs
- PrefixQName.cs
- MouseButton.cs
- XmlSchemaComplexType.cs
- PropertyStore.cs
- EncoderParameter.cs
- DataServiceExpressionVisitor.cs
- AnnotationHelper.cs
- CustomAttributeSerializer.cs
- ColumnHeader.cs
- ColumnResizeAdorner.cs
- WeakRefEnumerator.cs
- ObjectFullSpanRewriter.cs
- GregorianCalendar.cs
- XmlToDatasetMap.cs
- ErrorWrapper.cs
- FontCacheUtil.cs
- ImageCodecInfoPrivate.cs
- NameSpaceExtractor.cs
- LinkLabel.cs
- ObjectStateFormatter.cs
- BamlWriter.cs
- ImpersonationContext.cs
- DomainLiteralReader.cs
- SessionState.cs
- WebConfigurationManager.cs
- ResourceAssociationSet.cs
- DbUpdateCommandTree.cs
- TransformerInfo.cs
- MimeWriter.cs
- Size.cs