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
- AmbientLight.cs
- ExtensionSimplifierMarkupObject.cs
- NetworkInformationPermission.cs
- CompositeActivityTypeDescriptorProvider.cs
- AnnotationResource.cs
- GridViewSortEventArgs.cs
- PeerTransportSecuritySettings.cs
- DataGridViewRowHeaderCell.cs
- EventHandlingScope.cs
- SqlError.cs
- ValueUnavailableException.cs
- ConfigXmlAttribute.cs
- Keyboard.cs
- UserPreferenceChangingEventArgs.cs
- VerticalAlignConverter.cs
- PersonalizationStateInfo.cs
- WebControlAdapter.cs
- DataBoundControlParameterTarget.cs
- InkCanvasSelectionAdorner.cs
- SafePEFileHandle.cs
- SqlTriggerAttribute.cs
- Odbc32.cs
- RequestFactory.cs
- FormViewCommandEventArgs.cs
- ResourceAssociationSetEnd.cs
- WebPartMenu.cs
- SafeHandles.cs
- SiteMapPath.cs
- DataGridViewColumnCollectionEditor.cs
- PrimarySelectionGlyph.cs
- GridItemPattern.cs
- Operators.cs
- StringFunctions.cs
- ObjectDataSource.cs
- OutputCacheProfile.cs
- GetMemberBinder.cs
- ReadOnlyTernaryTree.cs
- SecurityContextKeyIdentifierClause.cs
- DataColumnMapping.cs
- mansign.cs
- Label.cs
- DataGridViewAccessibleObject.cs
- SafeProcessHandle.cs
- XPathNode.cs
- JsonFaultDetail.cs
- MetadataPropertyAttribute.cs
- MemoryMappedViewStream.cs
- NavigationCommands.cs
- InvokeGenerator.cs
- GridViewSortEventArgs.cs
- JapaneseCalendar.cs
- BamlBinaryWriter.cs
- EventLevel.cs
- CqlErrorHelper.cs
- PropertyGroupDescription.cs
- SqlDataSourceEnumerator.cs
- ConditionCollection.cs
- StorageComplexPropertyMapping.cs
- AsyncOperationManager.cs
- TypeConverterHelper.cs
- VisualBrush.cs
- EdmFunctionAttribute.cs
- mediaclock.cs
- CultureSpecificCharacterBufferRange.cs
- ContextBase.cs
- FunctionImportElement.cs
- EdmValidator.cs
- ClientApiGenerator.cs
- PathSegment.cs
- NativeWrapper.cs
- ServiceContractGenerator.cs
- LinkConverter.cs
- EncodingDataItem.cs
- SqlDependency.cs
- DataControlField.cs
- BaseDataBoundControl.cs
- NativeMethods.cs
- EntityCommandDefinition.cs
- IconHelper.cs
- FontStyles.cs
- AsyncResult.cs
- RadioButtonPopupAdapter.cs
- DataGridTablesFactory.cs
- SystemIPInterfaceProperties.cs
- MenuBase.cs
- PnrpPermission.cs
- QueryExpr.cs
- RegistryExceptionHelper.cs
- TrackingMemoryStreamFactory.cs
- StructuralType.cs
- DoubleStorage.cs
- MetadataException.cs
- SymbolDocumentGenerator.cs
- CheckPair.cs
- PackageDigitalSignature.cs
- ServiceHostingEnvironment.cs
- NativeMethods.cs
- PermissionSetEnumerator.cs
- LayoutEvent.cs
- ContentDisposition.cs