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
- SortFieldComparer.cs
- SmiRecordBuffer.cs
- CompositeControl.cs
- Encoder.cs
- ChtmlTextBoxAdapter.cs
- EmptyQuery.cs
- Wildcard.cs
- WindowsListViewScroll.cs
- Int16AnimationBase.cs
- TextInfo.cs
- PartialCachingAttribute.cs
- ReachDocumentReferenceSerializer.cs
- XPathNodeInfoAtom.cs
- BaseConfigurationRecord.cs
- TransactionState.cs
- ReflectPropertyDescriptor.cs
- InvokeSchedule.cs
- PolicyLevel.cs
- TableLayoutRowStyleCollection.cs
- Operator.cs
- NullToBooleanConverter.cs
- FileDataSourceCache.cs
- ThemeDictionaryExtension.cs
- HtmlHead.cs
- ContainerUIElement3D.cs
- Main.cs
- RenderContext.cs
- SizeIndependentAnimationStorage.cs
- BitmapMetadata.cs
- SqlServices.cs
- FileStream.cs
- InputReport.cs
- CertificateReferenceElement.cs
- Comparer.cs
- NativeActivityContext.cs
- CodeAttributeArgumentCollection.cs
- GatewayIPAddressInformationCollection.cs
- InputProcessorProfiles.cs
- DotNetATv1WindowsLogEntryDeserializer.cs
- PageCatalogPartDesigner.cs
- CodeThrowExceptionStatement.cs
- ItemContainerProviderWrapper.cs
- MouseBinding.cs
- FigureParaClient.cs
- SortQuery.cs
- ModelFunction.cs
- Memoizer.cs
- StickyNoteContentControl.cs
- MediaSystem.cs
- HttpListenerResponse.cs
- MatrixAnimationUsingPath.cs
- TemplateBaseAction.cs
- DataContractAttribute.cs
- cache.cs
- TextElementCollectionHelper.cs
- ParamArrayAttribute.cs
- BufferedReceiveManager.cs
- Margins.cs
- ExceptionUtil.cs
- WeakRefEnumerator.cs
- TypeHelper.cs
- DataGridViewRow.cs
- MsmqIntegrationChannelFactory.cs
- SpeechUI.cs
- MultipleViewPattern.cs
- BitConverter.cs
- Point3D.cs
- DataBinder.cs
- HtmlTitle.cs
- CodeTypeReferenceSerializer.cs
- SubMenuStyleCollectionEditor.cs
- SafeLocalMemHandle.cs
- WorkflowOwnerAsyncResult.cs
- CollectionViewProxy.cs
- StringFreezingAttribute.cs
- TargetConverter.cs
- PrintController.cs
- MetaDataInfo.cs
- FilterQueryOptionExpression.cs
- DBParameter.cs
- UriSectionData.cs
- CroppedBitmap.cs
- RangeBaseAutomationPeer.cs
- SByte.cs
- Speller.cs
- UrlMappingCollection.cs
- DependencyObjectPropertyDescriptor.cs
- LinqDataView.cs
- TextEditorMouse.cs
- HiddenFieldPageStatePersister.cs
- SamlSubject.cs
- EnumerableCollectionView.cs
- CheckBox.cs
- TreeNodeMouseHoverEvent.cs
- DataGridSortCommandEventArgs.cs
- Emitter.cs
- TemplateFactory.cs
- OutputCacheProfileCollection.cs
- ToolStripMenuItem.cs
- FormClosingEvent.cs