Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / UriTemplatePathSegment.cs / 2 / UriTemplatePathSegment.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System { using System.Collections.Specialized; using System.Diagnostics; using System.ServiceModel.Web; using System.Text; // This represents a Path segment, which can either be a Literal, a Variable or a Compound [DebuggerDisplay("Segment={originalSegment} Nature={nature}")] abstract class UriTemplatePathSegment { readonly bool endsWithSlash; readonly UriTemplatePartType nature; readonly string originalSegment; protected UriTemplatePathSegment(string originalSegment, UriTemplatePartType nature, bool endsWithSlash) { this.originalSegment = originalSegment; this.nature = nature; this.endsWithSlash = endsWithSlash; } public bool EndsWithSlash { get { return this.endsWithSlash; } } public UriTemplatePartType Nature { get { return this.nature; } } public string OriginalSegment { get { return this.originalSegment; } } public static UriTemplatePathSegment CreateFromUriTemplate(string segment, UriTemplate template) { // Identifying the type of segment - Literal|Compound|Variable switch (UriTemplateHelpers.IdentifyPartType(segment)) { case UriTemplatePartType.Literal: return UriTemplateLiteralPathSegment.CreateFromUriTemplate(segment, template); case UriTemplatePartType.Compound: return UriTemplateCompoundPathSegment.CreateFromUriTemplate(segment, template); case UriTemplatePartType.Variable: if (segment.EndsWith("/", StringComparison.Ordinal)) { string varName = template.AddPathVariable(UriTemplatePartType.Variable, segment.Substring(1, segment.Length - 3)); return new UriTemplateVariablePathSegment(segment, true, varName); } else { string varName = template.AddPathVariable(UriTemplatePartType.Variable, segment.Substring(1, segment.Length - 2)); return new UriTemplateVariablePathSegment(segment, false, varName); } default: Fx.Assert("Invalid value from IdentifyStringNature"); return null; } } public abstract void Bind(string[] values, ref int valueIndex, StringBuilder path); public abstract bool IsEquivalentTo(UriTemplatePathSegment other, bool ignoreTrailingSlash); public bool IsMatch(UriTemplateLiteralPathSegment segment) { return IsMatch(segment, false); } public abstract bool IsMatch(UriTemplateLiteralPathSegment segment, bool ignoreTrailingSlash); public abstract void Lookup(string segment, NameValueCollection boundParameters); } } // 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
- XmlBoundElement.cs
- diagnosticsswitches.cs
- BrowserCapabilitiesCodeGenerator.cs
- WebPartUserCapability.cs
- IRCollection.cs
- ThaiBuddhistCalendar.cs
- LinqDataSourceHelper.cs
- ContentValidator.cs
- RoutedUICommand.cs
- CodeStatementCollection.cs
- TextOptions.cs
- FileVersion.cs
- Identity.cs
- SimpleParser.cs
- DataGridItemEventArgs.cs
- StrokeDescriptor.cs
- XmlILTrace.cs
- ErrorHandler.cs
- ImageMap.cs
- ActivatedMessageQueue.cs
- XmlTextReaderImpl.cs
- ProgressBar.cs
- TreeView.cs
- JsonServiceDocumentSerializer.cs
- Substitution.cs
- ColumnMapTranslator.cs
- UIElementParaClient.cs
- DriveInfo.cs
- WinEventHandler.cs
- XmlSchemaValidator.cs
- ConnectionConsumerAttribute.cs
- ScrollBarRenderer.cs
- RoutedEventHandlerInfo.cs
- DescendantBaseQuery.cs
- JoinElimination.cs
- CryptographicAttribute.cs
- AnnotationResourceChangedEventArgs.cs
- Condition.cs
- ThreadExceptionEvent.cs
- Calendar.cs
- QueryPageSettingsEventArgs.cs
- Screen.cs
- ItemCollection.cs
- XsltQilFactory.cs
- TextLineResult.cs
- Vector3DCollection.cs
- BaseDataBoundControl.cs
- UdpUtility.cs
- DomainUpDown.cs
- InvalidContentTypeException.cs
- XmlSchemaComplexContentRestriction.cs
- OdbcStatementHandle.cs
- TripleDES.cs
- UIAgentAsyncEndRequest.cs
- MemoryRecordBuffer.cs
- ClaimComparer.cs
- RectAnimationUsingKeyFrames.cs
- ListBoxChrome.cs
- HostExecutionContextManager.cs
- FormsAuthenticationUser.cs
- DefaultWorkflowTransactionService.cs
- IdnMapping.cs
- InvalidPrinterException.cs
- EditingScope.cs
- ImageInfo.cs
- FileRecordSequenceHelper.cs
- UserNameSecurityTokenProvider.cs
- SelectingProviderEventArgs.cs
- NamedPipeHostedTransportConfiguration.cs
- CustomActivityDesigner.cs
- RowToParametersTransformer.cs
- DataRow.cs
- ContentValidator.cs
- NonVisualControlAttribute.cs
- CmsInterop.cs
- RangeValidator.cs
- ThreadInterruptedException.cs
- TypeConverterMarkupExtension.cs
- SystemWebCachingSectionGroup.cs
- DataGridViewAddColumnDialog.cs
- XmlTextWriter.cs
- NumericUpDownAcceleration.cs
- coordinator.cs
- TableRowGroup.cs
- AutomationEvent.cs
- DataGridComponentEditor.cs
- ClusterUtils.cs
- TimelineClockCollection.cs
- Rotation3DAnimationBase.cs
- IDispatchConstantAttribute.cs
- SelectionProviderWrapper.cs
- SafeNativeMemoryHandle.cs
- GenericTextProperties.cs
- DistinctQueryOperator.cs
- MD5.cs
- BaseParaClient.cs
- AppSecurityManager.cs
- CurrencyWrapper.cs
- VisualBrush.cs
- HttpServerUtilityWrapper.cs