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
- CheckBox.cs
- BulletDecorator.cs
- WCFBuildProvider.cs
- Style.cs
- Clause.cs
- contentDescriptor.cs
- SafeCryptHandles.cs
- CodeNamespace.cs
- NullToBooleanConverter.cs
- OutputCacheSection.cs
- RenderingEventArgs.cs
- ContainerParagraph.cs
- GenericsInstances.cs
- PersonalizationStateInfoCollection.cs
- CryptoHelper.cs
- ProxyWebPartConnectionCollection.cs
- MultiTrigger.cs
- RemotingException.cs
- DefaultTextStore.cs
- BuildProviderCollection.cs
- ReplacementText.cs
- Component.cs
- CngProperty.cs
- IisTraceListener.cs
- AnonymousIdentificationModule.cs
- BindingBase.cs
- TypeSystemProvider.cs
- CommandBinding.cs
- BindingNavigator.cs
- FontNamesConverter.cs
- XmlEncoding.cs
- DesignerWidgets.cs
- SqlCharStream.cs
- ToolZone.cs
- ThemeDictionaryExtension.cs
- TraceListener.cs
- PerformanceCountersElement.cs
- XmlCollation.cs
- SQLSingle.cs
- _FtpControlStream.cs
- GeneralTransform3DGroup.cs
- QueryExtender.cs
- ImageCreator.cs
- DefaultPrintController.cs
- CornerRadius.cs
- DataSetMappper.cs
- PropertyGridDesigner.cs
- InheritablePropertyChangeInfo.cs
- ByteConverter.cs
- XmlSchemaSimpleType.cs
- SafeBitVector32.cs
- SoapIncludeAttribute.cs
- ListBoxAutomationPeer.cs
- RijndaelManagedTransform.cs
- DataGridSortingEventArgs.cs
- SecureConversationServiceElement.cs
- StyleBamlRecordReader.cs
- ToolboxItem.cs
- Attributes.cs
- XmlSchemaAll.cs
- StylusDownEventArgs.cs
- ObjectContextServiceProvider.cs
- AttributeQuery.cs
- LineServicesCallbacks.cs
- ProfileParameter.cs
- DeferredSelectedIndexReference.cs
- OleDbRowUpdatedEvent.cs
- Executor.cs
- CompilerState.cs
- SessionIDManager.cs
- FileEnumerator.cs
- LeaseManager.cs
- CharKeyFrameCollection.cs
- TypeListConverter.cs
- ProgressPage.cs
- SimpleHandlerBuildProvider.cs
- BitmapEffectInput.cs
- WindowsTokenRoleProvider.cs
- DataGrid.cs
- SettingsContext.cs
- DateTimeConverter.cs
- ValidationResults.cs
- ClientSession.cs
- SmtpNegotiateAuthenticationModule.cs
- PackUriHelper.cs
- DataContractJsonSerializerOperationBehavior.cs
- Line.cs
- Adorner.cs
- UmAlQuraCalendar.cs
- FormatConvertedBitmap.cs
- UnsafeNativeMethodsPenimc.cs
- XmlSchemaProviderAttribute.cs
- Metafile.cs
- SystemWebSectionGroup.cs
- Nullable.cs
- TypeConverterMarkupExtension.cs
- XmlDataImplementation.cs
- DataGridColumnCollection.cs
- DESCryptoServiceProvider.cs
- FixUpCollection.cs