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
- IndependentlyAnimatedPropertyMetadata.cs
- BinaryFormatterWriter.cs
- ServiceObjectContainer.cs
- ScrollItemPatternIdentifiers.cs
- ImmutableAssemblyCacheEntry.cs
- PassportAuthenticationEventArgs.cs
- ResourceDescriptionAttribute.cs
- SortDescription.cs
- DataGridViewTopRowAccessibleObject.cs
- Switch.cs
- GeneralTransform3DTo2DTo3D.cs
- ParameterBinding.cs
- GiveFeedbackEventArgs.cs
- FontSourceCollection.cs
- uribuilder.cs
- DataGridViewTextBoxEditingControl.cs
- SpellerStatusTable.cs
- SafeNativeMethodsMilCoreApi.cs
- StoragePropertyMapping.cs
- DecoderExceptionFallback.cs
- StartFileNameEditor.cs
- PhysicalFontFamily.cs
- PixelFormats.cs
- QilVisitor.cs
- Main.cs
- Int32RectConverter.cs
- OleDbEnumerator.cs
- OpCodes.cs
- DataGridAddNewRow.cs
- _ListenerResponseStream.cs
- XmlReaderSettings.cs
- SqlDataSourceSelectingEventArgs.cs
- Light.cs
- XsdBuildProvider.cs
- CmsInterop.cs
- WmpBitmapDecoder.cs
- DLinqColumnProvider.cs
- OleDragDropHandler.cs
- Baml2006KeyRecord.cs
- Internal.cs
- EventLogTraceListener.cs
- CompilationSection.cs
- ClientSettingsStore.cs
- Win32Native.cs
- SafeBitVector32.cs
- CheckBox.cs
- ConfigurationElementProperty.cs
- CounterSetInstanceCounterDataSet.cs
- MoveSizeWinEventHandler.cs
- Permission.cs
- InvalidCommandTreeException.cs
- LabelAutomationPeer.cs
- Debug.cs
- Style.cs
- PinnedBufferMemoryStream.cs
- User.cs
- InfiniteIntConverter.cs
- InternalDispatchObject.cs
- StylusPointPropertyInfoDefaults.cs
- BasePattern.cs
- TemplateControlParser.cs
- Directory.cs
- ToolboxItemLoader.cs
- PreApplicationStartMethodAttribute.cs
- TrackBarRenderer.cs
- WebBrowser.cs
- TemplateField.cs
- BamlTreeNode.cs
- ReaderWriterLockWrapper.cs
- ParameterModifier.cs
- IImplicitResourceProvider.cs
- SQLBoolean.cs
- TypeSource.cs
- QilDataSource.cs
- MenuItem.cs
- COM2IPerPropertyBrowsingHandler.cs
- ProxyFragment.cs
- EmptyEnumerator.cs
- XmlNavigatorStack.cs
- PlacementWorkspace.cs
- HostExecutionContextManager.cs
- ProfileSettingsCollection.cs
- DatePickerTextBox.cs
- XmlToDatasetMap.cs
- ByteConverter.cs
- ElementsClipboardData.cs
- XmlHierarchicalEnumerable.cs
- PropertyDescriptorGridEntry.cs
- ReadOnlyActivityGlyph.cs
- FileChangeNotifier.cs
- HtmlToClrEventProxy.cs
- TypefaceMap.cs
- XmlExtensionFunction.cs
- RotateTransform.cs
- StateDesigner.Layouts.cs
- MediaSystem.cs
- ServiceHttpModule.cs
- GregorianCalendarHelper.cs
- OLEDB_Enum.cs
- Token.cs