Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / Channels / WebBodyFormatMessageProperty.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SingleSelectRootGridEntry.cs
- SelectingProviderEventArgs.cs
- AsmxEndpointPickerExtension.cs
- SimplePropertyEntry.cs
- TextReader.cs
- DrawingGroup.cs
- RequiredAttributeAttribute.cs
- GridSplitter.cs
- oledbmetadatacollectionnames.cs
- Part.cs
- PagePropertiesChangingEventArgs.cs
- TemplateControlCodeDomTreeGenerator.cs
- MappingException.cs
- EntitySqlQueryCacheEntry.cs
- Stack.cs
- Pair.cs
- DataReceivedEventArgs.cs
- XmlNotation.cs
- safemediahandle.cs
- ProfilePropertySettings.cs
- DeviceSpecificChoiceCollection.cs
- MenuItemBindingCollection.cs
- BinaryEditor.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- JpegBitmapDecoder.cs
- SiteMapProvider.cs
- X509SecurityTokenProvider.cs
- TableSectionStyle.cs
- ListItemCollection.cs
- MachineKeyConverter.cs
- WebPartConnection.cs
- RectAnimationUsingKeyFrames.cs
- TabletCollection.cs
- RectIndependentAnimationStorage.cs
- URLAttribute.cs
- CustomCredentialPolicy.cs
- UnsignedPublishLicense.cs
- InternalsVisibleToAttribute.cs
- MenuCommand.cs
- BrowserTree.cs
- ProtocolsConfigurationHandler.cs
- ScriptRef.cs
- ClrPerspective.cs
- Setter.cs
- FileDialogPermission.cs
- BoundPropertyEntry.cs
- RuntimeConfigLKG.cs
- ControlIdConverter.cs
- ToolStripArrowRenderEventArgs.cs
- QueryOperator.cs
- LinkTarget.cs
- WebHttpEndpointElement.cs
- SoapBinding.cs
- ObjectStorage.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- WindowProviderWrapper.cs
- OwnerDrawPropertyBag.cs
- Rfc2898DeriveBytes.cs
- TemplateComponentConnector.cs
- TcpServerChannel.cs
- AsyncOperationManager.cs
- RTLAwareMessageBox.cs
- DataTransferEventArgs.cs
- CustomPopupPlacement.cs
- AnimatedTypeHelpers.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- Directory.cs
- ReadContentAsBinaryHelper.cs
- ISFClipboardData.cs
- Encoding.cs
- ClassGenerator.cs
- ButtonColumn.cs
- DbConvert.cs
- TextServicesDisplayAttribute.cs
- ObjectPersistData.cs
- StickyNoteAnnotations.cs
- DeriveBytes.cs
- CorePropertiesFilter.cs
- Polyline.cs
- MatchingStyle.cs
- TiffBitmapDecoder.cs
- CorrelationManager.cs
- MouseWheelEventArgs.cs
- WebPartsPersonalization.cs
- PrePrepareMethodAttribute.cs
- BinaryNode.cs
- Console.cs
- RC2CryptoServiceProvider.cs
- DecoderFallback.cs
- Tool.cs
- TextTreeDeleteContentUndoUnit.cs
- OrderedHashRepartitionStream.cs
- BindingGroup.cs
- TableHeaderCell.cs
- XmlSerializerFactory.cs
- SqlClientMetaDataCollectionNames.cs
- SwitchExpression.cs
- RepeatButton.cs
- ReadOnlyObservableCollection.cs
- ResourceDisplayNameAttribute.cs