2004-05-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / ControlParameter.cs
1 //
2 // System.Web.UI.WebControls.ControlParameter
3 //
4 // Authors:
5 //      Ben Maurer (bmaurer@users.sourceforge.net)
6 //
7 // (C) 2003 Ben Maurer
8 //
9
10 #if NET_2_0
11 using System.Collections;
12 using System.Collections.Specialized;
13 using System.Text;
14
15 namespace System.Web.UI.WebControls {
16         public class ControlParameter : Parameter {
17
18                 public ControlParameter () : base ()
19                 {
20                 }
21
22                 protected ControlParameter (ControlParameter original) : base (original)
23                 {
24                         this.ControlID = original.ControlID;
25                         this.PropertyName = original.PropertyName;
26                 }
27                 
28                 public ControlParameter (string name, string controlID) : base (name)
29                 {
30                         ControlID = controlID;
31                 }
32                 
33                 public ControlParameter (string name, string controlID, string propertyName) : base (name)
34                 {
35                         ControlID = controlID;
36                         PropertyName = propertyName;
37                 }
38                 
39                 public ControlParameter (string name, TypeCode type, string controlID, string propertyName) : base (name, type)
40                 {
41                         ControlID = controlID;
42                         PropertyName = propertyName;
43                 }
44                 
45                 protected override Parameter Clone ()
46                 {
47                         return new ControlParameter (this);
48                 }
49                 
50                 [MonoTODO]
51                 protected override object Evaluate (Control control)
52                 {
53                         throw new NotImplementedException ();
54                 }
55                 
56                 public string ControlID {
57                         get {
58                                 string s = ViewState ["ControlID"] as string;
59                                 if (s != null)
60                                         return s;
61                                 
62                                 return "";
63                         }
64                         set {
65                                 if (ControlID != value) {
66                                         ViewState ["ControlID"] = value;
67                                         OnParameterChanged ();
68                                 }
69                         }
70                 }
71                 
72                 public string PropertyName {
73                         get {
74                                 string s = ViewState ["PropertyName"] as string;
75                                 if (s != null)
76                                         return s;
77                                 
78                                 return "";
79                         }
80                         set {
81                                 
82                                 if (PropertyName != value) {
83                                         ViewState ["PropertyName"] = value;
84                                         OnParameterChanged ();
85                                 }
86                         }
87                 }
88         }
89 }
90 #endif
91