Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / UriTemplateVariableQueryValue.cs / 2 / UriTemplateVariableQueryValue.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System { using System.Collections.Specialized; using System.ServiceModel.Web; using System.Text; using System.Web; using System.ServiceModel.Channels; class UriTemplateVariableQueryValue : UriTemplateQueryValue { readonly string varName; public UriTemplateVariableQueryValue(string varName) : base(UriTemplatePartType.Variable) { Fx.Assert(!string.IsNullOrEmpty(varName), "bad variable segment"); this.varName = varName; } public override void Bind(string keyName, string[] values, ref int valueIndex, StringBuilder query) { Fx.Assert(valueIndex < values.Length, "Not enough values to bind"); if (values[valueIndex] == null) { valueIndex++; } else { query.AppendFormat("&{0}={1}", UrlUtility.UrlEncode(keyName, Encoding.UTF8), UrlUtility.UrlEncode(values[valueIndex++], Encoding.UTF8)); } } public override bool IsEquivalentTo(UriTemplateQueryValue other) { if (other == null) { Fx.Assert("why would we ever call this?"); return false; } return (other.Nature == UriTemplatePartType.Variable); } public override void Lookup(string value, NameValueCollection boundParameters) { boundParameters.Add(this.varName, value); } } } // 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
- WorkerRequest.cs
- Soap.cs
- mediaclock.cs
- DiagnosticsConfiguration.cs
- XPathSelfQuery.cs
- Tag.cs
- UIElement.cs
- SerializeAbsoluteContext.cs
- XmlSerializerNamespaces.cs
- ArrayList.cs
- AttributeTable.cs
- SqlCacheDependency.cs
- AsyncCompletedEventArgs.cs
- SqlFacetAttribute.cs
- TaiwanCalendar.cs
- IQueryable.cs
- ContentType.cs
- DataGridBoolColumn.cs
- ISFClipboardData.cs
- BitmapEffectInputData.cs
- AbsoluteQuery.cs
- XmlReaderDelegator.cs
- DefaultProxySection.cs
- PlanCompilerUtil.cs
- DefaultEventAttribute.cs
- Style.cs
- SortedSet.cs
- PersistenceException.cs
- TextSelectionHighlightLayer.cs
- MsiStyleLogWriter.cs
- XomlCompiler.cs
- dbdatarecord.cs
- HtmlInputButton.cs
- _ContextAwareResult.cs
- TogglePattern.cs
- UnmanagedMemoryStreamWrapper.cs
- RoleService.cs
- manifestimages.cs
- TablePatternIdentifiers.cs
- IPEndPointCollection.cs
- Menu.cs
- DataServiceConfiguration.cs
- EventPropertyMap.cs
- DataGridViewButtonColumn.cs
- SerializationObjectManager.cs
- SqlDuplicator.cs
- WorkflowMarkupSerializationProvider.cs
- Events.cs
- SchemaImporterExtensionElementCollection.cs
- Canvas.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- XmlText.cs
- DataGrid.cs
- StorageBasedPackageProperties.cs
- MarkupProperty.cs
- dataobject.cs
- XmlDataSource.cs
- NetNamedPipeBinding.cs
- TextUtf8RawTextWriter.cs
- StreamWriter.cs
- SocketStream.cs
- TreeNodeClickEventArgs.cs
- XmlSchemaSimpleType.cs
- CodeAttributeArgumentCollection.cs
- FontSource.cs
- TypeHelpers.cs
- RecipientInfo.cs
- HitTestFilterBehavior.cs
- VoiceInfo.cs
- SAPICategories.cs
- DataBindingHandlerAttribute.cs
- SerializerWriterEventHandlers.cs
- ContentPlaceHolder.cs
- SafeSecurityHandles.cs
- TranslateTransform3D.cs
- BitmapData.cs
- SuppressMergeCheckAttribute.cs
- SendMailErrorEventArgs.cs
- TableCell.cs
- ProcessModuleCollection.cs
- PolicyManager.cs
- Point3DKeyFrameCollection.cs
- ContextStack.cs
- ReaderOutput.cs
- EvidenceTypeDescriptor.cs
- PluralizationServiceUtil.cs
- WebBrowserUriTypeConverter.cs
- CodeTypeReferenceExpression.cs
- PerformanceCounter.cs
- WindowsGrip.cs
- SqlParameterCollection.cs
- XpsS0ValidatingLoader.cs
- TextDecorations.cs
- _MultipleConnectAsync.cs
- WebPartCollection.cs
- TemplateDefinition.cs
- InstanceNameConverter.cs
- AbandonedMutexException.cs
- ListViewGroupConverter.cs
- ImmutablePropertyDescriptorGridEntry.cs