2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / System.Web / System.Web.UI / PostBackOptions.cs
1 //
2 // System.Web.UI.PostBackOptions.cs
3 //
4 // Authors:
5 //      Sanjay Gupta (gsanjay@novell.com)
6 //
7 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
8 //
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
17 // 
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
20 // 
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 //
29
30 #if NET_2_0
31 using System;
32
33 namespace System.Web.UI
34 {
35         public sealed class PostBackOptions
36         {
37                 private Control control;
38                 private string argument;
39                 private string actionUrl;
40                 private bool autoPostBack;
41                 private bool requiresJavaScriptProtocol;
42                 private bool trackFocus;
43                 private bool clientSubmit;
44                 private bool performValidation;
45                 private string validationGroup;
46                 
47                 public PostBackOptions (Control control) : this (control, string.Empty, string.Empty, false, false, false, 
48                                                                 false, false, string.Empty)
49                 {
50                 }
51
52                 public PostBackOptions (Control control, string argument) : this (control, argument, string.Empty, false, 
53                                                                                 false, false, false, false, string.Empty)
54                 {
55                 }
56
57                 public PostBackOptions (Control control, string argument, string actionUrl, bool isAutoPostBack,
58                                         bool isJavaScriptProtocolRequired, bool isTrackFocus, bool isClientSubmit,
59                                         bool isValidationPerformed, string validatingGroup)
60                 {
61                         this.control = control;
62                         this.argument = argument;
63                         this.actionUrl = actionUrl;
64                         this.autoPostBack = isAutoPostBack;
65                         this.requiresJavaScriptProtocol = isJavaScriptProtocolRequired;
66                         this.trackFocus = isTrackFocus;
67                         this.clientSubmit = isClientSubmit;
68                         this.performValidation = isValidationPerformed;
69                         this.validationGroup = validatingGroup;
70                 }
71
72                 public string ActionUrl {
73                         get { return actionUrl; }
74                         set { actionUrl = value; }
75                 }
76
77                 public string Argument {
78                         get { return  argument; }
79                         set { argument = value; }
80                 }
81
82                 public bool AutoPostBack {
83                         get { return autoPostBack; }
84                         set { autoPostBack = value; }
85                 }
86
87                 public bool ClientSubmit {
88                         get { return clientSubmit; }
89                         set { clientSubmit = value; }
90                 }
91                 
92                 public bool PerformValidation {
93                         get { return performValidation; }
94                         set { performValidation = value; }
95                 }
96
97                 public bool RequiresJavaScriptProtocol {
98                         get { return requiresJavaScriptProtocol; }
99                         set { requiresJavaScriptProtocol = value; }
100                 }
101
102                 public Control TargetControl {
103                         get { return control; }
104                         set { control = value; }
105                 }
106
107                 public bool TrackFocus {
108                         get { return trackFocus; }
109                         set { trackFocus = value; }
110                 }
111
112                 public string ValidationGroup {
113                         get { return validationGroup; }
114                         set { validationGroup = value; }
115                 }               
116         }
117 }
118
119 #endif