Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / xsp / System / Web / Extensions / Script / Services / RestHandlerFactory.cs / 1 / RestHandlerFactory.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Script.Services { internal class RestHandlerFactory : IHttpHandlerFactory { internal const string ClientProxyRequestPathInfo = "/js"; internal const string ClientDebugProxyRequestPathInfo = "/jsdebug"; public virtual IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated) { if (context == null) { throw new ArgumentNullException("context"); } if (IsClientProxyRequest(context.Request.PathInfo)) { // It's a request for client side proxies return new RestClientProxyHandler(); } else { // The request is an actual call to a server method return RestHandler.CreateHandler(context); } } public virtual void ReleaseHandler(IHttpHandler handler) { } // Detects if this is a request we want to intercept, i.e. invocation or proxy request internal static bool IsRestRequest(HttpContext context) { return IsRestMethodCall(context.Request) || IsClientProxyRequest(context.Request.PathInfo); } // Detects if this is a method invocation, i.e. webservice call or page method call internal static bool IsRestMethodCall(HttpRequest request) { return !String.IsNullOrEmpty(request.PathInfo) && (request.ContentType.StartsWith("application/json;", StringComparison.OrdinalIgnoreCase) || string.Equals(request.ContentType, "application/json", StringComparison.OrdinalIgnoreCase)); } internal static bool IsClientProxyDebugRequest(string pathInfo) { return string.Equals(pathInfo, ClientDebugProxyRequestPathInfo, StringComparison.OrdinalIgnoreCase); } internal static bool IsClientProxyRequest(string pathInfo) { return (string.Equals(pathInfo, ClientProxyRequestPathInfo, StringComparison.OrdinalIgnoreCase) || IsClientProxyDebugRequest(pathInfo)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Script.Services { internal class RestHandlerFactory : IHttpHandlerFactory { internal const string ClientProxyRequestPathInfo = "/js"; internal const string ClientDebugProxyRequestPathInfo = "/jsdebug"; public virtual IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated) { if (context == null) { throw new ArgumentNullException("context"); } if (IsClientProxyRequest(context.Request.PathInfo)) { // It's a request for client side proxies return new RestClientProxyHandler(); } else { // The request is an actual call to a server method return RestHandler.CreateHandler(context); } } public virtual void ReleaseHandler(IHttpHandler handler) { } // Detects if this is a request we want to intercept, i.e. invocation or proxy request internal static bool IsRestRequest(HttpContext context) { return IsRestMethodCall(context.Request) || IsClientProxyRequest(context.Request.PathInfo); } // Detects if this is a method invocation, i.e. webservice call or page method call internal static bool IsRestMethodCall(HttpRequest request) { return !String.IsNullOrEmpty(request.PathInfo) && (request.ContentType.StartsWith("application/json;", StringComparison.OrdinalIgnoreCase) || string.Equals(request.ContentType, "application/json", StringComparison.OrdinalIgnoreCase)); } internal static bool IsClientProxyDebugRequest(string pathInfo) { return string.Equals(pathInfo, ClientDebugProxyRequestPathInfo, StringComparison.OrdinalIgnoreCase); } internal static bool IsClientProxyRequest(string pathInfo) { return (string.Equals(pathInfo, ClientProxyRequestPathInfo, StringComparison.OrdinalIgnoreCase) || IsClientProxyDebugRequest(pathInfo)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AppDomainCompilerProxy.cs
- ResXBuildProvider.cs
- BitStream.cs
- NamedObject.cs
- ExtendedProperty.cs
- HttpStreamXmlDictionaryReader.cs
- DateTimePicker.cs
- PolyQuadraticBezierSegment.cs
- XamlInt32CollectionSerializer.cs
- RawStylusActions.cs
- XmlEntityReference.cs
- AdornerPresentationContext.cs
- XmlNullResolver.cs
- DesignerSelectionListAdapter.cs
- DynamicEntity.cs
- PerformanceCounters.cs
- SerialStream.cs
- XmlDataImplementation.cs
- UpdatePanel.cs
- ApplicationContext.cs
- RequiredFieldValidator.cs
- SelectingProviderEventArgs.cs
- HttpCachePolicy.cs
- OrderedDictionary.cs
- CodeArrayIndexerExpression.cs
- GridPattern.cs
- ObjectAnimationUsingKeyFrames.cs
- Int32Converter.cs
- FormViewDeletedEventArgs.cs
- XmlDocument.cs
- ContextQuery.cs
- DoubleAnimationBase.cs
- HealthMonitoringSectionHelper.cs
- SynchronizationScope.cs
- SafeFileMappingHandle.cs
- RegionData.cs
- SqlExpressionNullability.cs
- AuthenticodeSignatureInformation.cs
- Bitmap.cs
- ListViewGroup.cs
- HtmlControlDesigner.cs
- ProfileManager.cs
- InkCanvasAutomationPeer.cs
- RuleEngine.cs
- WindowsListViewSubItem.cs
- ConnectionManagementElement.cs
- WindowsListViewSubItem.cs
- SoapIncludeAttribute.cs
- DoubleAverageAggregationOperator.cs
- SafeBitVector32.cs
- TypeConverterHelper.cs
- XmlSchemaSimpleContent.cs
- HtmlProps.cs
- ViewLoader.cs
- CompressStream.cs
- XsltLoader.cs
- Table.cs
- ClientUrlResolverWrapper.cs
- MetaModel.cs
- SqlConnectionPoolProviderInfo.cs
- InputLanguageProfileNotifySink.cs
- ActivityTypeCodeDomSerializer.cs
- Transactions.cs
- SectionVisual.cs
- BamlLocalizationDictionary.cs
- MatrixTransform.cs
- diagnosticsswitches.cs
- GridLength.cs
- XmlWriter.cs
- TextParentUndoUnit.cs
- messageonlyhwndwrapper.cs
- StorageModelBuildProvider.cs
- GPRECT.cs
- UnsafeNativeMethods.cs
- TypeForwardedToAttribute.cs
- AnnotationAuthorChangedEventArgs.cs
- PiiTraceSource.cs
- Brush.cs
- MatrixTransform3D.cs
- GridViewCommandEventArgs.cs
- WizardStepBase.cs
- XmlNamespaceMappingCollection.cs
- AuthenticationSection.cs
- HtmlInputPassword.cs
- HttpModuleCollection.cs
- Glyph.cs
- Scripts.cs
- IndexedString.cs
- OleDbErrorCollection.cs
- HelpKeywordAttribute.cs
- BaseComponentEditor.cs
- AnnouncementInnerClientCD1.cs
- RSAOAEPKeyExchangeFormatter.cs
- COM2ExtendedTypeConverter.cs
- KeyFrames.cs
- XmlCustomFormatter.cs
- FormsAuthenticationTicket.cs
- DeflateStreamAsyncResult.cs
- path.cs
- Positioning.cs