Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Routing / UrlRoutingHandler.cs / 1305376 / UrlRoutingHandler.cs
namespace System.Web.Routing { using System; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Web; using System.Runtime.CompilerServices; [TypeForwardedFrom("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")] public abstract class UrlRoutingHandler : IHttpHandler { private RouteCollection _routeCollection; protected virtual bool IsReusable { get { return false; } } [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "This needs to be settable for unit tests.")] public RouteCollection RouteCollection { get { if (_routeCollection == null) { _routeCollection = RouteTable.Routes; } return _routeCollection; } set { _routeCollection = value; } } protected virtual void ProcessRequest(HttpContext httpContext) { ProcessRequest(new HttpContextWrapper(httpContext)); } protected virtual void ProcessRequest(HttpContextBase httpContext) { RouteData routeData = RouteCollection.GetRouteData(httpContext); if (routeData == null) { throw new HttpException(404, SR.GetString(SR.UrlRoutingHandler_NoRouteMatches)); } IRouteHandler routeHandler = routeData.RouteHandler; if (routeHandler == null) { throw new InvalidOperationException(SR.GetString(SR.UrlRoutingModule_NoRouteHandler)); } RequestContext requestContext = new RequestContext(httpContext, routeData); IHttpHandler httpHandler = routeHandler.GetHttpHandler(requestContext); if (httpHandler == null) { throw new InvalidOperationException( String.Format( CultureInfo.CurrentUICulture, SR.GetString(SR.UrlRoutingModule_NoHttpHandler), routeHandler.GetType())); } VerifyAndProcessRequest(httpHandler, httpContext); } protected abstract void VerifyAndProcessRequest(IHttpHandler httpHandler, HttpContextBase httpContext); #region IHttpHandler Members bool IHttpHandler.IsReusable { get { return IsReusable; } } void IHttpHandler.ProcessRequest(HttpContext context) { ProcessRequest(context); } #endregion } } // 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
- CodeTypeDeclarationCollection.cs
- ProcessThreadCollection.cs
- DbConnectionInternal.cs
- DiscoveryClientBindingElement.cs
- HttpServerVarsCollection.cs
- DataGridViewLinkColumn.cs
- X509Certificate2Collection.cs
- ToolTip.cs
- PolygonHotSpot.cs
- UriSectionReader.cs
- GenerateTemporaryTargetAssembly.cs
- NumericUpDownAcceleration.cs
- WSHttpSecurity.cs
- ButtonBaseAutomationPeer.cs
- FaultConverter.cs
- BaseTreeIterator.cs
- ExclusiveNamedPipeTransportManager.cs
- CachedPathData.cs
- SemaphoreFullException.cs
- GroupItem.cs
- FontFamilyIdentifier.cs
- KeyEvent.cs
- ServicePointManager.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- HashUtility.cs
- LambdaCompiler.Logical.cs
- Helper.cs
- WindowsRebar.cs
- BookmarkUndoUnit.cs
- HotSpotCollectionEditor.cs
- TypeUnloadedException.cs
- ToolStripContentPanelRenderEventArgs.cs
- SeekStoryboard.cs
- DataServiceHost.cs
- ControlBindingsConverter.cs
- DBCSCodePageEncoding.cs
- ViewKeyConstraint.cs
- DragStartedEventArgs.cs
- SpotLight.cs
- HostUtils.cs
- LambdaCompiler.Logical.cs
- XPathSelectionIterator.cs
- DescendantQuery.cs
- COAUTHIDENTITY.cs
- WebExceptionStatus.cs
- ApplicationTrust.cs
- Typeface.cs
- EntityClassGenerator.cs
- Calendar.cs
- HideDisabledControlAdapter.cs
- Win32SafeHandles.cs
- WebPartCollection.cs
- OrderByExpression.cs
- LinqDataSourceEditData.cs
- remotingproxy.cs
- DbQueryCommandTree.cs
- SecurityUtils.cs
- MarkupProperty.cs
- ExpressionUtilities.cs
- AnnotationHighlightLayer.cs
- NTAccount.cs
- GeometryHitTestResult.cs
- PrivilegeNotHeldException.cs
- PropertyInformationCollection.cs
- DataSourceBooleanViewSchemaConverter.cs
- SystemSounds.cs
- SoapElementAttribute.cs
- CompilerGeneratedAttribute.cs
- PropertyValueUIItem.cs
- XPathNodeIterator.cs
- HashSet.cs
- ProviderConnectionPointCollection.cs
- CatalogZoneAutoFormat.cs
- BitmapScalingModeValidation.cs
- AutomationPeer.cs
- PropertyNames.cs
- TreeNodeSelectionProcessor.cs
- SchemaCollectionCompiler.cs
- TcpDuplicateContext.cs
- SerializationException.cs
- DistinctQueryOperator.cs
- X509Chain.cs
- DataGridViewCellEventArgs.cs
- DataObjectCopyingEventArgs.cs
- HighlightComponent.cs
- SuppressMergeCheckAttribute.cs
- BitmapCodecInfoInternal.cs
- DynamicResourceExtensionConverter.cs
- LockCookie.cs
- ClientRolePrincipal.cs
- Win32.cs
- XmlObjectSerializerReadContextComplexJson.cs
- Bezier.cs
- TargetParameterCountException.cs
- MonitoringDescriptionAttribute.cs
- EasingQuaternionKeyFrame.cs
- Compress.cs
- TriggerAction.cs
- GraphicsPathIterator.cs
- DocumentEventArgs.cs