**** Merged from MCS ****
[mono-project.git] / mcs / class / System.Web.Services / System.Web.Services / WebMethodAttribute.cs
blob2826a415c982fb96af65920d40c66c20184a98d8
1 //
2 // System.Web.Services.WebMethodAttribute.cs
3 //
4 // Author:
5 // Tim Coleman (tim@timcoleman.com)
6 //
7 // Copyright (C) Tim Coleman, 2002
8 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 //
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 //
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.EnterpriseServices;
33 namespace System.Web.Services {
34 [AttributeUsage(AttributeTargets.Method, Inherited = true)]
35 public sealed class WebMethodAttribute : Attribute {
37 #region Fields
39 bool bufferResponse;
40 int cacheDuration;
41 string description;
42 bool enableSession;
43 string messageName;
44 TransactionOption transactionOption;
46 #endregion // Fields
48 #region Constructors
50 public WebMethodAttribute ()
51 : this (false, TransactionOption.Disabled, 0, true)
55 public WebMethodAttribute (bool enableSession)
56 : this (enableSession, TransactionOption.Disabled, 0, true)
60 public WebMethodAttribute (bool enableSession, TransactionOption transactionOption)
61 : this (enableSession, transactionOption, 0, true)
65 public WebMethodAttribute (bool enableSession, TransactionOption transactionOption, int cacheDuration)
66 : this (enableSession, transactionOption, cacheDuration, true)
70 public WebMethodAttribute (bool enableSession, TransactionOption transactionOption, int cacheDuration, bool bufferResponse)
72 this.bufferResponse = bufferResponse;
73 this.cacheDuration = cacheDuration;
74 this.enableSession = enableSession;
75 this.transactionOption = transactionOption;
77 this.description = String.Empty;
78 this.messageName = String.Empty;
81 #endregion // Constructors
83 #region Properties
85 public bool BufferResponse {
86 get { return bufferResponse; }
87 set { bufferResponse = value; }
90 public int CacheDuration {
91 get { return cacheDuration; }
92 set { cacheDuration = value; }
95 public string Description {
96 get { return description; }
97 set { description = value; }
100 public bool EnableSession {
101 get { return enableSession; }
102 set { enableSession = value; }
105 public string MessageName {
106 get { return messageName; }
107 set { messageName = value; }
110 public TransactionOption TransactionOption {
111 get { return transactionOption; }
112 set { transactionOption = value; }
115 #endregion // Properties