2 // System.Web.Services.WebMethodAttribute.cs
\r
5 // Tim Coleman (tim@timcoleman.com)
\r
7 // Copyright (C) Tim Coleman, 2002
\r
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:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
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;
\r
33 namespace System.Web.Services {
\r
34 [AttributeUsage(AttributeTargets.Method, Inherited = true)]
\r
35 public sealed class WebMethodAttribute : Attribute {
\r
39 bool bufferResponse;
\r
44 TransactionOption transactionOption;
\r
46 #endregion // Fields
\r
48 #region Constructors
\r
50 public WebMethodAttribute ()
\r
51 : this (false, TransactionOption.Disabled, 0, true)
\r
55 public WebMethodAttribute (bool enableSession)
\r
56 : this (enableSession, TransactionOption.Disabled, 0, true)
\r
60 public WebMethodAttribute (bool enableSession, TransactionOption transactionOption)
\r
61 : this (enableSession, transactionOption, 0, true)
\r
65 public WebMethodAttribute (bool enableSession, TransactionOption transactionOption, int cacheDuration)
\r
66 : this (enableSession, transactionOption, cacheDuration, true)
\r
70 public WebMethodAttribute (bool enableSession, TransactionOption transactionOption, int cacheDuration, bool bufferResponse)
\r
72 this.bufferResponse = bufferResponse;
\r
73 this.cacheDuration = cacheDuration;
\r
74 this.enableSession = enableSession;
\r
75 this.transactionOption = transactionOption;
\r
77 this.description = String.Empty;
\r
78 this.messageName = String.Empty;
\r
81 #endregion // Constructors
\r
85 public bool BufferResponse {
\r
86 get { return bufferResponse; }
\r
87 set { bufferResponse = value; }
\r
90 public int CacheDuration {
\r
91 get { return cacheDuration; }
\r
92 set { cacheDuration = value; }
\r
95 public string Description {
\r
96 get { return description; }
\r
97 set { description = value; }
\r
100 public bool EnableSession {
\r
101 get { return enableSession; }
\r
102 set { enableSession = value; }
\r
105 public string MessageName {
\r
106 get { return messageName; }
\r
107 set { messageName = value; }
\r
110 public TransactionOption TransactionOption {
\r
111 get { return transactionOption; }
\r
112 set { transactionOption = value; }
\r
115 #endregion // Properties
\r