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
- QuaternionRotation3D.cs
- XmlRawWriter.cs
- LinkedResourceCollection.cs
- BitFlagsGenerator.cs
- WindowsMenu.cs
- MasterPageCodeDomTreeGenerator.cs
- AbstractExpressions.cs
- NumberFunctions.cs
- NotifyIcon.cs
- ChineseLunisolarCalendar.cs
- DateTime.cs
- StringValueConverter.cs
- DataSourceCacheDurationConverter.cs
- EmptyStringExpandableObjectConverter.cs
- DiagnosticsConfigurationHandler.cs
- AutomationElement.cs
- ShaperBuffers.cs
- DirectoryInfo.cs
- GridViewHeaderRowPresenter.cs
- ServiceControllerDesigner.cs
- MissingSatelliteAssemblyException.cs
- PageThemeParser.cs
- EDesignUtil.cs
- httpstaticobjectscollection.cs
- KeyPressEvent.cs
- storepermission.cs
- DPAPIProtectedConfigurationProvider.cs
- SHA1.cs
- DomNameTable.cs
- AnnotationMap.cs
- VisualStyleRenderer.cs
- XmlAttributeOverrides.cs
- ComplexTypeEmitter.cs
- Matrix3DStack.cs
- SqlDataSourceQueryEditor.cs
- UnaryNode.cs
- InputMethod.cs
- UInt64Storage.cs
- Route.cs
- VirtualPathProvider.cs
- SqlSupersetValidator.cs
- NamespaceImport.cs
- MetadataItemEmitter.cs
- RTLAwareMessageBox.cs
- ActivatableWorkflowsQueryResult.cs
- OutputScope.cs
- XmlEntity.cs
- StorageInfo.cs
- Debug.cs
- IdentifierService.cs
- LineSegment.cs
- ClusterSafeNativeMethods.cs
- XmlEncoding.cs
- GridViewDeleteEventArgs.cs
- HebrewCalendar.cs
- XsltLoader.cs
- PropertyGridEditorPart.cs
- CellTreeNodeVisitors.cs
- DbParameterHelper.cs
- LocalizationComments.cs
- FixedSOMContainer.cs
- DesignerSerializerAttribute.cs
- TreeNodeBinding.cs
- HtmlWindowCollection.cs
- MergeFailedEvent.cs
- SQLSingleStorage.cs
- TransformGroup.cs
- TargetInvocationException.cs
- ReflectEventDescriptor.cs
- ServicePrincipalNameElement.cs
- DataErrorValidationRule.cs
- UMPAttributes.cs
- ExpandSegmentCollection.cs
- ViewGenResults.cs
- AutomationPatternInfo.cs
- basenumberconverter.cs
- SafeRightsManagementHandle.cs
- ProfilePropertyNameValidator.cs
- ISCIIEncoding.cs
- SqlNamer.cs
- IisTraceWebEventProvider.cs
- DataGridViewDataConnection.cs
- HwndHost.cs
- PrintControllerWithStatusDialog.cs
- CardSpaceException.cs
- TraceListeners.cs
- MonthChangedEventArgs.cs
- FilterEventArgs.cs
- DictionaryKeyPropertyAttribute.cs
- BitStream.cs
- TypeInfo.cs
- StretchValidation.cs
- ArgumentValueSerializer.cs
- ClientSponsor.cs
- PropertyGroupDescription.cs
- AnnotationService.cs
- HtmlElementCollection.cs
- WebBrowserNavigatedEventHandler.cs
- MouseWheelEventArgs.cs
- PreviewPrintController.cs