Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / System.ServiceModel.Activation / System / ServiceModel / Activation / ServiceRoute.cs / 1305376 / ServiceRoute.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Activation { using System; using System.Globalization; using System.Web.Routing; public class ServiceRoute : Route { internal const string LeftCurlyBracket = "{"; internal const string RightCurlyBracket = "}"; internal const string UnmatchedPathSegment = "{*pathInfo}"; internal const char PathSeperator = '/'; public ServiceRoute(string routePrefix, ServiceHostFactoryBase serviceHostFactory, Type serviceType) : base(CheckAndCreateRouteString(routePrefix), new ServiceRouteHandler(routePrefix, serviceHostFactory, serviceType)) { if (TD.AspNetRouteIsEnabled()) { TD.AspNetRoute(routePrefix, serviceType.AssemblyQualifiedName, serviceHostFactory.GetType().AssemblyQualifiedName); } } static string CheckAndCreateRouteString(string routePrefix) { // aspnet routing integration is supported only under aspnet compat mode ServiceHostingEnvironment.EnsureInitialized(); if (!ServiceHostingEnvironment.AspNetCompatibilityEnabled) { throw FxTrace.Exception.AsError(new InvalidOperationException(SR.Hosting_RouteServiceRequiresCompatibilityMode)); } // we support emptystring as routeprfix as aspnet allows it if (routePrefix == null) { throw FxTrace.Exception.ArgumentNull("routePrefix"); } else if (routePrefix.Contains(LeftCurlyBracket) || routePrefix.Contains(RightCurlyBracket)) { throw FxTrace.Exception.Argument("routePrefix", SR.Hosting_CurlyBracketFoundInRoutePrefix("{", "}")); } if(routePrefix.EndsWith(PathSeperator.ToString(), StringComparison.CurrentCultureIgnoreCase) || routePrefix.Equals(String.Empty, StringComparison.CurrentCultureIgnoreCase)) { routePrefix = string.Format(CultureInfo.CurrentCulture, "{0}{1}", routePrefix, UnmatchedPathSegment); } else { routePrefix = string.Format(CultureInfo.CurrentCulture, "{0}/{1}", routePrefix, UnmatchedPathSegment); } return routePrefix; } } } // 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
- WSMessageEncoding.cs
- DbDataReader.cs
- ToolboxItemCollection.cs
- HostSecurityManager.cs
- ProfileSettingsCollection.cs
- Roles.cs
- ButtonPopupAdapter.cs
- EntityConnection.cs
- TextEditorCharacters.cs
- CommonRemoteMemoryBlock.cs
- SqlBooleanizer.cs
- LinqExpressionNormalizer.cs
- Double.cs
- ErrorEventArgs.cs
- XomlSerializationHelpers.cs
- AdPostCacheSubstitution.cs
- OdbcException.cs
- ScriptResourceAttribute.cs
- XmlCollation.cs
- AttributeEmitter.cs
- SupportsEventValidationAttribute.cs
- TemplatedMailWebEventProvider.cs
- DataSourceProvider.cs
- MetadataSerializer.cs
- GridErrorDlg.cs
- ExpressionParser.cs
- PhysicalFontFamily.cs
- DoubleCollectionValueSerializer.cs
- GridViewSortEventArgs.cs
- Win32NamedPipes.cs
- DragStartedEventArgs.cs
- HttpModuleAction.cs
- ReverseQueryOperator.cs
- HostedNamedPipeTransportManager.cs
- AuthStoreRoleProvider.cs
- odbcmetadatacollectionnames.cs
- HttpFileCollection.cs
- HwndHostAutomationPeer.cs
- SqlConnectionHelper.cs
- DocumentXmlWriter.cs
- LinkedList.cs
- TextEndOfLine.cs
- GridViewItemAutomationPeer.cs
- BamlBinaryReader.cs
- XmlRootAttribute.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- UpdateManifestForBrowserApplication.cs
- DataGridViewCellStateChangedEventArgs.cs
- Section.cs
- InArgumentConverter.cs
- LineGeometry.cs
- BindingCollection.cs
- ContainerAction.cs
- pingexception.cs
- BitStream.cs
- FormattedTextSymbols.cs
- HttpCookiesSection.cs
- ComplexObject.cs
- EntitySet.cs
- BindingsCollection.cs
- EncodingDataItem.cs
- TypeDelegator.cs
- ComponentRenameEvent.cs
- WebAdminConfigurationHelper.cs
- BehaviorDragDropEventArgs.cs
- InitiatorSessionSymmetricTransportSecurityProtocol.cs
- TimeSpan.cs
- XamlStream.cs
- CodeDirectoryCompiler.cs
- UncommonField.cs
- ScaleTransform3D.cs
- EventPrivateKey.cs
- TdsParserStateObject.cs
- mediaeventshelper.cs
- GridToolTip.cs
- OleDbInfoMessageEvent.cs
- XPathConvert.cs
- AuthenticationServiceManager.cs
- DoubleCollectionConverter.cs
- ConfigurationLocation.cs
- NumericUpDownAccelerationCollection.cs
- Geometry.cs
- StyleBamlTreeBuilder.cs
- Item.cs
- TimeIntervalCollection.cs
- XmlProcessingInstruction.cs
- CodeAttributeDeclaration.cs
- DragStartedEventArgs.cs
- SequenceQuery.cs
- DataBinding.cs
- ComponentRenameEvent.cs
- XsltException.cs
- WebControl.cs
- StandardBindingReliableSessionElement.cs
- ThicknessAnimationBase.cs
- DataGridPagerStyle.cs
- Imaging.cs
- JapaneseLunisolarCalendar.cs
- SystemIPInterfaceStatistics.cs
- LocationUpdates.cs