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
- X509IssuerSerialKeyIdentifierClause.cs
- _Events.cs
- dsa.cs
- ArrayElementGridEntry.cs
- XmlSignatureProperties.cs
- EntityCommandDefinition.cs
- ListBoxItem.cs
- ModelTypeConverter.cs
- OrderToken.cs
- RegexRunnerFactory.cs
- BulletedListEventArgs.cs
- DataGridHeaderBorder.cs
- SetStoryboardSpeedRatio.cs
- BaseTreeIterator.cs
- SimpleRecyclingCache.cs
- PublishLicense.cs
- OpCodes.cs
- InputProviderSite.cs
- QilNode.cs
- ConcurrencyMode.cs
- WebPartChrome.cs
- Quad.cs
- MenuItemCollectionEditor.cs
- Action.cs
- ScaleTransform3D.cs
- EventHandlersStore.cs
- ProfileService.cs
- BindingValueChangedEventArgs.cs
- WebPartDisplayModeEventArgs.cs
- GroupDescription.cs
- CallbackTimeoutsElement.cs
- rsa.cs
- CommonDialog.cs
- BitmapSource.cs
- SiteIdentityPermission.cs
- XmlUtil.cs
- SqlDataSource.cs
- MatrixConverter.cs
- ApplicationServiceHelper.cs
- TypeElement.cs
- DataGridViewDataErrorEventArgs.cs
- StringAttributeCollection.cs
- BindingRestrictions.cs
- GridViewColumnCollectionChangedEventArgs.cs
- RootDesignerSerializerAttribute.cs
- DataGridViewControlCollection.cs
- TypeNameConverter.cs
- Opcode.cs
- OracleNumber.cs
- ReaderWriterLock.cs
- MembershipAdapter.cs
- XmlSchemaGroup.cs
- LogExtentCollection.cs
- EllipseGeometry.cs
- Point4D.cs
- ListViewItem.cs
- Header.cs
- SwitchExpression.cs
- MSG.cs
- FormsAuthenticationConfiguration.cs
- PopupEventArgs.cs
- ScrollProperties.cs
- StrokeNodeData.cs
- IApplicationTrustManager.cs
- RelationshipEntry.cs
- NativeMethods.cs
- StructuredCompositeActivityDesigner.cs
- IssuedTokenServiceElement.cs
- StreamSecurityUpgradeProvider.cs
- BindUriHelper.cs
- COSERVERINFO.cs
- ALinqExpressionVisitor.cs
- WSTrust.cs
- ExternalFile.cs
- KnownBoxes.cs
- Resources.Designer.cs
- DetailsViewInsertEventArgs.cs
- PTUtility.cs
- XmlCharCheckingReader.cs
- SystemException.cs
- DomainConstraint.cs
- BitmapEncoder.cs
- FontDriver.cs
- Contracts.cs
- RealizedColumnsBlock.cs
- WindowsPen.cs
- NumericPagerField.cs
- SHA256.cs
- DrawingCollection.cs
- XmlSchemaParticle.cs
- HtmlSelect.cs
- Application.cs
- IdentityNotMappedException.cs
- Helper.cs
- BaseParagraph.cs
- HttpCookieCollection.cs
- DeferredSelectedIndexReference.cs
- WindowsListViewGroup.cs
- AttributedMetaModel.cs
- HwndSourceParameters.cs