Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / Channels / WebBodyFormatMessageProperty.cs / 1 / WebBodyFormatMessageProperty.cs
//----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------------------
using System.Globalization;
namespace System.ServiceModel.Channels
{
public sealed class WebBodyFormatMessageProperty : IMessageProperty
{
WebContentFormat format;
static WebBodyFormatMessageProperty jsonProperty;
public const string Name = "WebBodyFormatMessageProperty";
static WebBodyFormatMessageProperty xmlProperty;
static WebBodyFormatMessageProperty rawProperty;
public WebBodyFormatMessageProperty(WebContentFormat format)
{
if (format == WebContentFormat.Default)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SR2.GetString(SR2.DefaultContentFormatNotAllowedInProperty)));
}
this.format = format;
}
public WebContentFormat Format
{
get {return this.format; }
}
internal static WebBodyFormatMessageProperty JsonProperty
{
get
{
if (jsonProperty == null)
{
jsonProperty = new WebBodyFormatMessageProperty(WebContentFormat.Json);
}
return jsonProperty;
}
}
internal static WebBodyFormatMessageProperty XmlProperty
{
get
{
if (xmlProperty == null)
{
xmlProperty = new WebBodyFormatMessageProperty(WebContentFormat.Xml);
}
return xmlProperty;
}
}
internal static WebBodyFormatMessageProperty RawProperty
{
get
{
if (rawProperty == null)
{
rawProperty = new WebBodyFormatMessageProperty(WebContentFormat.Raw);
}
return rawProperty;
}
}
public IMessageProperty CreateCopy()
{
return this;
}
public override string ToString()
{
return String.Format(CultureInfo.InvariantCulture, SR2.GetString(SR2.WebBodyFormatPropertyToString, this.Format.ToString()));
}
}
}
// 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
- DbProviderFactoriesConfigurationHandler.cs
- ItemChangedEventArgs.cs
- TdsParserSessionPool.cs
- OutputWindow.cs
- ScrollBarRenderer.cs
- ResourceContainerWrapper.cs
- SessionParameter.cs
- TextDecorations.cs
- XmlKeywords.cs
- XamlValidatingReader.cs
- Error.cs
- HeaderCollection.cs
- ContextItem.cs
- AtomParser.cs
- CodeMemberField.cs
- GetPageNumberCompletedEventArgs.cs
- GuidConverter.cs
- WindowsSidIdentity.cs
- ListViewUpdateEventArgs.cs
- ConfigUtil.cs
- RetrieveVirtualItemEventArgs.cs
- PageFunction.cs
- XmlSignificantWhitespace.cs
- IWorkflowDebuggerService.cs
- DoubleStorage.cs
- GiveFeedbackEvent.cs
- securitymgrsite.cs
- DataControlFieldCollection.cs
- NotifyCollectionChangedEventArgs.cs
- _AuthenticationState.cs
- ErrorEventArgs.cs
- PromptEventArgs.cs
- EncodingTable.cs
- TreeViewAutomationPeer.cs
- XmlConvert.cs
- MultipartContentParser.cs
- COM2TypeInfoProcessor.cs
- __Filters.cs
- Span.cs
- TrackBarRenderer.cs
- validationstate.cs
- WebScriptEndpoint.cs
- HttpCookieCollection.cs
- PrinterUnitConvert.cs
- PropertyInformation.cs
- Int16AnimationBase.cs
- DesignerHelpers.cs
- Message.cs
- BufferAllocator.cs
- OleServicesContext.cs
- NamedPipeTransportSecurity.cs
- CancellationTokenSource.cs
- PeerContact.cs
- RowUpdatedEventArgs.cs
- ActivityStatusChangeEventArgs.cs
- RecommendedAsConfigurableAttribute.cs
- DummyDataSource.cs
- ToolCreatedEventArgs.cs
- FlagsAttribute.cs
- DrawingGroup.cs
- SinglePageViewer.cs
- RegexRunner.cs
- WebOperationContext.cs
- _Semaphore.cs
- CallTemplateAction.cs
- EndpointInfoCollection.cs
- Util.cs
- SponsorHelper.cs
- ImplicitInputBrush.cs
- SqlTriggerAttribute.cs
- ISAPIWorkerRequest.cs
- RoleServiceManager.cs
- XmlDocumentType.cs
- FieldToken.cs
- PropertyDescriptorComparer.cs
- FrameworkElement.cs
- ClientScriptManager.cs
- ToolTipAutomationPeer.cs
- Point3DAnimation.cs
- PresentationUIStyleResources.cs
- SourceFileInfo.cs
- URLString.cs
- SymbolTable.cs
- QilLoop.cs
- SystemFonts.cs
- TimelineGroup.cs
- Accessible.cs
- Configuration.cs
- XmlHierarchicalEnumerable.cs
- WaitingCursor.cs
- UnsafeMethods.cs
- coordinator.cs
- PrtCap_Builder.cs
- ConnectionPoolManager.cs
- FlowNode.cs
- BidPrivateBase.cs
- FactoryGenerator.cs
- PageEventArgs.cs
- SharedPersonalizationStateInfo.cs
- ZoneMembershipCondition.cs