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
- AuthorizationRuleCollection.cs
- SiteMapNodeCollection.cs
- SHA512.cs
- HttpDictionary.cs
- UnionExpr.cs
- ExceptionValidationRule.cs
- ScriptResourceAttribute.cs
- SingleQueryOperator.cs
- X509CertificateRecipientClientCredential.cs
- ScriptingSectionGroup.cs
- ThemeDictionaryExtension.cs
- EnumerationRangeValidationUtil.cs
- Substitution.cs
- HexParser.cs
- BuilderPropertyEntry.cs
- XmlSchemaAppInfo.cs
- ISAPIWorkerRequest.cs
- WindowsFormsLinkLabel.cs
- MultiBindingExpression.cs
- SingletonChannelAcceptor.cs
- MenuTracker.cs
- XamlHttpHandlerFactory.cs
- ToolStripContentPanelRenderEventArgs.cs
- SetterBase.cs
- DependencyPropertyValueSerializer.cs
- Odbc32.cs
- RegexBoyerMoore.cs
- MSHTMLHost.cs
- FontCollection.cs
- X500Name.cs
- AssociationEndMember.cs
- ClientConvert.cs
- ArithmeticException.cs
- WorkItem.cs
- MarkupCompiler.cs
- DataShape.cs
- Descriptor.cs
- NodeFunctions.cs
- TrackingMemoryStreamFactory.cs
- ApplicationHost.cs
- MetadataSource.cs
- GroupBox.cs
- ContainsRowNumberChecker.cs
- ConstructorBuilder.cs
- BinaryUtilClasses.cs
- OracleDataAdapter.cs
- DataList.cs
- ToolStripMenuItem.cs
- HtmlElementCollection.cs
- TextTreeExtractElementUndoUnit.cs
- WrapperEqualityComparer.cs
- base64Transforms.cs
- DiscoveryDefaults.cs
- TreeChangeInfo.cs
- BCLDebug.cs
- DateTimeValueSerializerContext.cs
- MediaScriptCommandRoutedEventArgs.cs
- ConstructorBuilder.cs
- AnonymousIdentificationSection.cs
- QueryModel.cs
- EventsTab.cs
- ISCIIEncoding.cs
- SiteMap.cs
- DocumentGrid.cs
- UnsettableComboBox.cs
- IncrementalHitTester.cs
- BrowserInteropHelper.cs
- StreamInfo.cs
- ObjectDataSourceFilteringEventArgs.cs
- XmlDeclaration.cs
- ColumnReorderedEventArgs.cs
- EntityType.cs
- InstanceHandleReference.cs
- ClipboardData.cs
- CollectionContainer.cs
- SQLInt16.cs
- WinInet.cs
- FixedHighlight.cs
- ErrorFormatter.cs
- XmlFormatMapping.cs
- IpcChannelHelper.cs
- EventHandlerService.cs
- XslNumber.cs
- BaseResourcesBuildProvider.cs
- Ppl.cs
- DataListItem.cs
- HttpMethodAttribute.cs
- LayoutUtils.cs
- DataGridLength.cs
- DemultiplexingClientMessageFormatter.cs
- PropertyItemInternal.cs
- WpfGeneratedKnownTypes.cs
- LabelLiteral.cs
- TableItemStyle.cs
- LocalTransaction.cs
- ModuleElement.cs
- FilterUserControlBase.cs
- ScrollEventArgs.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- Font.cs