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
- WebPartConnectionsDisconnectVerb.cs
- IconHelper.cs
- AuthenticatedStream.cs
- EventRecord.cs
- Argument.cs
- ArraySortHelper.cs
- Content.cs
- CqlParserHelpers.cs
- OleDragDropHandler.cs
- MouseGesture.cs
- SafeFileMapViewHandle.cs
- CatalogPartChrome.cs
- StrokeRenderer.cs
- BuildDependencySet.cs
- XmlWriter.cs
- PerformanceCounter.cs
- TimeoutException.cs
- InfoCardRSACryptoProvider.cs
- OdbcConnectionHandle.cs
- ResolveMatchesApril2005.cs
- EmptyTextWriter.cs
- ResolveCriteria11.cs
- SendActivityDesigner.cs
- Point4D.cs
- BufferedReceiveManager.cs
- Function.cs
- WindowPatternIdentifiers.cs
- NullableLongSumAggregationOperator.cs
- OleDbSchemaGuid.cs
- TableTextElementCollectionInternal.cs
- QueryStringHandler.cs
- OleDbSchemaGuid.cs
- GeometryValueSerializer.cs
- DocumentScope.cs
- HTTPNotFoundHandler.cs
- RC2.cs
- SqlRecordBuffer.cs
- NativeMethods.cs
- ClientSideQueueItem.cs
- MaskInputRejectedEventArgs.cs
- BindingEntityInfo.cs
- OdbcConnectionString.cs
- PopupControlService.cs
- RepeatBehaviorConverter.cs
- ConsoleKeyInfo.cs
- BoundPropertyEntry.cs
- UndoEngine.cs
- DispatcherExceptionFilterEventArgs.cs
- XmlDataCollection.cs
- FacetEnabledSchemaElement.cs
- _OverlappedAsyncResult.cs
- DBSchemaRow.cs
- EventLogPermission.cs
- XmlNodeList.cs
- LogAppendAsyncResult.cs
- DropShadowEffect.cs
- Constraint.cs
- GregorianCalendarHelper.cs
- SelectionGlyph.cs
- CodeExpressionStatement.cs
- PropertyChangingEventArgs.cs
- ItemsPanelTemplate.cs
- HyperlinkAutomationPeer.cs
- PhysicalAddress.cs
- GZipObjectSerializer.cs
- MergePropertyDescriptor.cs
- ProgressBarRenderer.cs
- DataStreams.cs
- StandardToolWindows.cs
- EditorOptionAttribute.cs
- CanExecuteRoutedEventArgs.cs
- AttributeQuery.cs
- XhtmlTextWriter.cs
- altserialization.cs
- _StreamFramer.cs
- CatalogPart.cs
- RTLAwareMessageBox.cs
- RemoteHelper.cs
- RowTypeElement.cs
- CryptoApi.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- TreeNodeStyleCollection.cs
- SpotLight.cs
- HtmlInputPassword.cs
- Win32.cs
- ListParaClient.cs
- DataTemplateKey.cs
- ShapingEngine.cs
- StrongNameMembershipCondition.cs
- CngAlgorithmGroup.cs
- BuildManagerHost.cs
- PointCollection.cs
- Vector3dCollection.cs
- WebBrowserContainer.cs
- HttpListenerContext.cs
- EmptyEnumerator.cs
- DragDrop.cs
- SerializableAttribute.cs
- SmtpFailedRecipientsException.cs
- SqlConnectionString.cs