Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / ContentOnlyMessage.cs / 1 / ContentOnlyMessage.cs
//---------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------------------- namespace System.ServiceModel.Channels { using System; using System.ServiceModel; using System.IO; using System.ServiceModel.Diagnostics; using System.Xml; ////// Base class for non-SOAP messages /// abstract class ContentOnlyMessage : Message { MessageHeaders headers; MessageProperties properties; protected ContentOnlyMessage() { this.headers = new MessageHeaders(MessageVersion.None); } public override MessageHeaders Headers { get { if (IsDisposed) { #pragma warning suppress 56503 // [....], required by base class contract throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); } return this.headers; } } public override MessageProperties Properties { get { if (IsDisposed) { #pragma warning suppress 56503 // [....], required by base class contract throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); } if (this.properties == null) { this.properties = new MessageProperties(); } return this.properties; } } public override MessageVersion Version { get { return headers.MessageVersion; } } protected override void OnBodyToString(XmlDictionaryWriter writer) { OnWriteBodyContents(writer); } } class StringMessage : ContentOnlyMessage { string data; public StringMessage(string data) : base() { this.data = data; } public override bool IsEmpty { get { return String.IsNullOrEmpty(this.data); } } protected override void OnWriteBodyContents(XmlDictionaryWriter writer) { if (data != null && data.Length > 0) { writer.WriteElementString("BODY", data); } } } class NullMessage : StringMessage { public NullMessage() : base(string.Empty) { } } } // 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
- _Events.cs
- COM2IDispatchConverter.cs
- StateBag.cs
- NameValuePair.cs
- EngineSiteSapi.cs
- LayeredChannelListener.cs
- StylusOverProperty.cs
- ToolStripPanelSelectionBehavior.cs
- StringFormat.cs
- WMIInterop.cs
- XPathSingletonIterator.cs
- GroupLabel.cs
- UniqueID.cs
- TextReader.cs
- CacheOutputQuery.cs
- ToolBarTray.cs
- DocumentOutline.cs
- RuleSettings.cs
- LinkButton.cs
- EditingCoordinator.cs
- RequestCachePolicyConverter.cs
- SqlWebEventProvider.cs
- TextParaClient.cs
- StrongNameSignatureInformation.cs
- CodeIdentifiers.cs
- HttpRequestWrapper.cs
- SystemResourceKey.cs
- DashStyle.cs
- WindowVisualStateTracker.cs
- SerializerProvider.cs
- HtmlPanelAdapter.cs
- ViewRendering.cs
- TypedRowHandler.cs
- ColumnBinding.cs
- DeferredReference.cs
- DataObject.cs
- _HeaderInfoTable.cs
- LogStore.cs
- DataGridLength.cs
- CorrelationTokenTypeConvertor.cs
- OleDbRowUpdatingEvent.cs
- TreeView.cs
- DesignerGenericWebPart.cs
- BindStream.cs
- TypeSystem.cs
- NamedPipeTransportElement.cs
- XmlSchemaExporter.cs
- SafeFileMappingHandle.cs
- TextLineResult.cs
- HwndStylusInputProvider.cs
- SendActivityDesignerTheme.cs
- CompressedStack.cs
- ReadOnlyCollection.cs
- PackageRelationshipSelector.cs
- IconConverter.cs
- SourceFileBuildProvider.cs
- InvalidWMPVersionException.cs
- PeerNameRegistration.cs
- Error.cs
- ToolbarAUtomationPeer.cs
- DataKeyPropertyAttribute.cs
- InfoCardMasterKey.cs
- Compensate.cs
- CryptoApi.cs
- QueryRelOp.cs
- IssuedTokensHeader.cs
- EntitySet.cs
- FileDataSourceCache.cs
- Source.cs
- RemoveStoryboard.cs
- TextServicesDisplayAttribute.cs
- UIAgentAsyncEndRequest.cs
- TextServicesProperty.cs
- RemotingSurrogateSelector.cs
- DataViewSettingCollection.cs
- InvokeProviderWrapper.cs
- LocatorManager.cs
- StringDictionary.cs
- MSAANativeProvider.cs
- ToolBarButtonDesigner.cs
- Blend.cs
- ContextBase.cs
- HttpProfileGroupBase.cs
- OleDbRowUpdatedEvent.cs
- ManipulationStartedEventArgs.cs
- AspCompat.cs
- FontEmbeddingManager.cs
- MenuAdapter.cs
- GetMemberBinder.cs
- MinMaxParagraphWidth.cs
- BuildTopDownAttribute.cs
- RowUpdatedEventArgs.cs
- SQLBytesStorage.cs
- UriTemplateClientFormatter.cs
- Matrix.cs
- CustomTypeDescriptor.cs
- WindowsGraphics2.cs
- AssemblySettingAttributes.cs
- WindowsSlider.cs
- HWStack.cs