Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Routing / System / ServiceModel / Routing / DelegatingHeader.cs / 1305376 / DelegatingHeader.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Routing { using System; using System.ServiceModel; using System.ServiceModel.Channels; using System.Xml; using System.Runtime; class DelegatingHeader : MessageHeader { int index; MessageHeaderInfo info; MessageHeaders originalHeaders; public DelegatingHeader(MessageHeaderInfo info, MessageHeaders originalHeaders) { Fx.Assert(info != null, "info is required"); Fx.Assert(originalHeaders != null, "originalHeaders is required"); this.info = info; this.originalHeaders = originalHeaders; this.index = -1; } void EnsureIndex() { if (this.index < 0) { this.index = this.originalHeaders.FindHeader(this.info.Name, this.info.Namespace); if (this.index < 0) { throw FxTrace.Exception.AsError(new InvalidOperationException(SR.SourceHeaderNotFound(this.info.Name, this.info.Namespace))); } } } protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion) { this.EnsureIndex(); this.originalHeaders.WriteHeaderContents(index, writer); this.index = -1; } protected override void OnWriteStartHeader(XmlDictionaryWriter writer, MessageVersion messageVersion) { this.EnsureIndex(); this.originalHeaders.WriteStartHeader(this.index, writer); } public override string Name { get { return this.info.Name; } } public override string Namespace { get { return this.info.Namespace; } } public override bool MustUnderstand { get { return this.info.MustUnderstand; } } public override string Actor { get { return this.info.Actor; } } public override bool IsReferenceParameter { get { return this.info.IsReferenceParameter; } } public override bool Relay { get { return base.Relay; } } } } // 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
- HuffModule.cs
- SafeHandles.cs
- Psha1DerivedKeyGenerator.cs
- ISCIIEncoding.cs
- TriggerActionCollection.cs
- Context.cs
- ExpressionNormalizer.cs
- CustomAttributeSerializer.cs
- ITextView.cs
- TextElementCollection.cs
- CodeVariableReferenceExpression.cs
- handlecollector.cs
- Internal.cs
- BinaryOperationBinder.cs
- LayoutExceptionEventArgs.cs
- KeyTime.cs
- WindowsContainer.cs
- CodeExpressionCollection.cs
- StorageMappingFragment.cs
- UseLicense.cs
- DefaultHttpHandler.cs
- BindingNavigator.cs
- OdbcConnectionHandle.cs
- OdbcDataAdapter.cs
- DocumentsTrace.cs
- IisTraceWebEventProvider.cs
- RadioButtonStandardAdapter.cs
- CurrencyWrapper.cs
- SystemDiagnosticsSection.cs
- WindowProviderWrapper.cs
- WorkerRequest.cs
- BamlLocalizableResourceKey.cs
- TransformPatternIdentifiers.cs
- SingleAnimationBase.cs
- ToolZone.cs
- Bitmap.cs
- ConsoleKeyInfo.cs
- Schema.cs
- TextWriter.cs
- CryptographicAttribute.cs
- PeerNameRegistration.cs
- Zone.cs
- DataTableReaderListener.cs
- DBDataPermissionAttribute.cs
- SignalGate.cs
- ProfileEventArgs.cs
- TypeSystem.cs
- Transform3D.cs
- HttpRequest.cs
- SQLCharsStorage.cs
- MsmqIntegrationBindingElement.cs
- DynamicResourceExtensionConverter.cs
- XmlLangPropertyAttribute.cs
- _BasicClient.cs
- DataGridViewCellStyleChangedEventArgs.cs
- WrappedReader.cs
- HttpUnhandledOperationInvoker.cs
- ProfileSettings.cs
- MethodCallTranslator.cs
- BindingListCollectionView.cs
- EdmProperty.cs
- CodeComment.cs
- EntityAdapter.cs
- DataSourceCacheDurationConverter.cs
- X509Certificate.cs
- GacUtil.cs
- WebPartEventArgs.cs
- ImageClickEventArgs.cs
- DataErrorValidationRule.cs
- TextEditorContextMenu.cs
- ListBindingHelper.cs
- DBCommandBuilder.cs
- DelegateOutArgument.cs
- ValueTypeFixupInfo.cs
- OutputCacheSection.cs
- Listbox.cs
- DataSpaceManager.cs
- WorkerRequest.cs
- AlternationConverter.cs
- HtmlUtf8RawTextWriter.cs
- XamlGridLengthSerializer.cs
- COM2Enum.cs
- QueryCacheEntry.cs
- ViewBase.cs
- AlphabetConverter.cs
- sortedlist.cs
- RelationshipType.cs
- XsltQilFactory.cs
- CompatibleIComparer.cs
- InternalCache.cs
- Utils.cs
- PeerInvitationResponse.cs
- ProxyWebPartConnectionCollection.cs
- PeerNeighborManager.cs
- ProgressBarAutomationPeer.cs
- CharacterMetricsDictionary.cs
- ValidationEventArgs.cs
- Currency.cs
- MsmqInputChannelListener.cs
- SqlInternalConnection.cs