Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / Web / WebInvokeAttribute.cs / 1 / WebInvokeAttribute.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Web { using System; using System.ServiceModel.Description; using System.ServiceModel.Dispatcher; using System.ServiceModel.Channels; using System.ServiceModel.Web; using System.ServiceModel.Administration; [AttributeUsage(AttributeTargets.Method)] public sealed class WebInvokeAttribute : Attribute, IOperationBehavior, IWmiInstanceProvider { WebMessageBodyStyle bodyStyle; bool isBodyStyleDefined; bool isRequestMessageFormatSet; bool isResponseMessageFormatSet; string method; // http verb WebMessageFormat requestMessageFormat; WebMessageFormat responseMessageFormat; string uriTemplate; // Note: HttpTransferEndpointBehavior interprets uriTemplate as: null means 'no opinion', whereas string.Empty means relative path of "" public WebInvokeAttribute() { } public WebMessageBodyStyle BodyStyle { get { return this.bodyStyle; } set { if (!WebMessageBodyStyleHelper.IsDefined(value)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value")); } this.bodyStyle = value; this.isBodyStyleDefined = true; } } public bool IsBodyStyleSetExplicitly { get { return this.isBodyStyleDefined; } } public bool IsRequestFormatSetExplicitly { get { return this.isRequestMessageFormatSet; } } public bool IsResponseFormatSetExplicitly { get { return this.isResponseMessageFormatSet; } } public string Method { get { return this.method; } set { this.method = value; } } public WebMessageFormat RequestFormat { get { return this.requestMessageFormat; } set { if (!WebMessageFormatHelper.IsDefined(value)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value")); } this.requestMessageFormat = value; this.isRequestMessageFormatSet = true; } } public WebMessageFormat ResponseFormat { get { return this.responseMessageFormat; } set { if (!WebMessageFormatHelper.IsDefined(value)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value")); } this.responseMessageFormat = value; this.isResponseMessageFormatSet = true; } } public string UriTemplate { get { return this.uriTemplate; } set { this.uriTemplate = value; } } void IOperationBehavior.AddBindingParameters(OperationDescription operationDescription, BindingParameterCollection bindingParameters) { }// do nothing void IOperationBehavior.ApplyClientBehavior(OperationDescription operationDescription, ClientOperation clientOperation) { }// do nothing void IOperationBehavior.ApplyDispatchBehavior(OperationDescription operationDescription, DispatchOperation dispatchOperation) { }// do nothing void IOperationBehavior.Validate(OperationDescription operationDescription) { }// do nothing internal WebMessageBodyStyle GetBodyStyleOrDefault(WebMessageBodyStyle defaultStyle) { if (this.IsBodyStyleSetExplicitly) { return this.BodyStyle; } else { return defaultStyle; } } void IWmiInstanceProvider.FillInstance(IWmiInstance wmiInstance) { if (wmiInstance == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("wmiInstance"); } wmiInstance.SetProperty("BodyStyle", this.BodyStyle.ToString()); wmiInstance.SetProperty("IsBodyStyleSetExplicitly", this.IsBodyStyleSetExplicitly.ToString()); wmiInstance.SetProperty("RequestFormat", this.RequestFormat.ToString()); wmiInstance.SetProperty("IsRequestFormatSetExplicitly", this.IsRequestFormatSetExplicitly.ToString()); wmiInstance.SetProperty("ResponseFormat", this.ResponseFormat.ToString()); wmiInstance.SetProperty("IsResponseFormatSetExplicitly", this.IsResponseFormatSetExplicitly.ToString()); wmiInstance.SetProperty("UriTemplate", this.UriTemplate); wmiInstance.SetProperty("Method", this.Method); } string IWmiInstanceProvider.GetInstanceType() { return "WebInvokeAttribute"; } } } // 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
- ListSortDescription.cs
- ArglessEventHandlerProxy.cs
- TabletCollection.cs
- SqlOuterApplyReducer.cs
- CompoundFileIOPermission.cs
- MachinePropertyVariants.cs
- TemplateBamlTreeBuilder.cs
- SplitContainer.cs
- ValueTypeFieldReference.cs
- FontConverter.cs
- SecurityContextTokenCache.cs
- DataServiceConfiguration.cs
- SchemaComplexType.cs
- SystemIPInterfaceProperties.cs
- CompleteWizardStep.cs
- PaintEvent.cs
- XslAstAnalyzer.cs
- SafeEventLogReadHandle.cs
- RegexCode.cs
- SourceElementsCollection.cs
- MetadataArtifactLoaderCompositeResource.cs
- Dump.cs
- VariableQuery.cs
- Directory.cs
- TransactionsSectionGroup.cs
- VariantWrapper.cs
- FormsAuthenticationUser.cs
- DesignerTransaction.cs
- ResourcePermissionBaseEntry.cs
- BinHexDecoder.cs
- ToolZoneDesigner.cs
- CompiledQuery.cs
- DelegateTypeInfo.cs
- Aggregates.cs
- XhtmlConformanceSection.cs
- Rotation3DAnimationUsingKeyFrames.cs
- DocumentStream.cs
- CodePageUtils.cs
- SyndicationDeserializer.cs
- IntegrationExceptionEventArgs.cs
- WarningException.cs
- TraceHandler.cs
- XmlReader.cs
- FreezableCollection.cs
- InternalDuplexChannelFactory.cs
- PageRouteHandler.cs
- XmlSchemaAnnotated.cs
- TextEndOfParagraph.cs
- SafeFileHandle.cs
- Win32.cs
- XmlTextWriter.cs
- Journal.cs
- AttributeExtensions.cs
- GridViewColumnHeaderAutomationPeer.cs
- DiscoveryReference.cs
- XmlEncodedRawTextWriter.cs
- TCEAdapterGenerator.cs
- SystemSounds.cs
- PreviewPrintController.cs
- OracleParameter.cs
- GlobalEventManager.cs
- RayHitTestParameters.cs
- ShapingWorkspace.cs
- SoapIgnoreAttribute.cs
- XPathSelectionIterator.cs
- LowerCaseStringConverter.cs
- DateTimeFormat.cs
- Rect.cs
- RotateTransform3D.cs
- RevocationPoint.cs
- WindowsMenu.cs
- FontClient.cs
- HttpContextServiceHost.cs
- PersistChildrenAttribute.cs
- MainMenu.cs
- MeshGeometry3D.cs
- PropertyPathConverter.cs
- SafeMemoryMappedViewHandle.cs
- FixedSOMElement.cs
- DropTarget.cs
- AssemblyResourceLoader.cs
- TextView.cs
- List.cs
- ConstructorNeedsTagAttribute.cs
- CompilerLocalReference.cs
- PartitionResolver.cs
- Boolean.cs
- TextSegment.cs
- JoinElimination.cs
- PlaceHolder.cs
- PipeStream.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- ParameterToken.cs
- DynamicPhysicalDiscoSearcher.cs
- MetadataHelper.cs
- ScalarOps.cs
- BidPrivateBase.cs
- CatalogPartChrome.cs
- Image.cs
- ObjectConverter.cs