New test.
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls.WebParts / EditorPart.cs
1 //
2 // System.Web.UI.WebControls.WebParts.EditorPart.cs
3 //
4 // Authors:
5 //      Chris Toshok (toshok@ximian.com)
6 //
7 // (C) 2006 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
32 using System.Collections;
33 using System.ComponentModel;
34
35 namespace System.Web.UI.WebControls.WebParts
36 {
37
38         [BindableAttribute(false)]
39         [Designer ("System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
40         public abstract class EditorPart : Part
41         {       
42                 bool                            display = true;
43                 WebPart                         webPartToEdit;
44 #if false
45                 WebPartManager          manager;
46                 EditorZoneBase          zone;
47 #endif
48                 object zone;
49                 string                          displayTitle;
50                 
51
52                 protected EditorPart() {}
53
54                 public abstract bool ApplyChanges ();
55
56                 protected override IDictionary GetDesignModeState ()
57                 {
58                         throw new NotImplementedException ();
59                 }
60
61                 protected internal override void OnPreRender (EventArgs e)
62                 {
63                         if(zone ==  null)
64                                 throw new InvalidOperationException();
65                         base.OnPreRender(e);
66                         if(!Display)
67                                 Visible = false;
68                 }
69 #if false
70                 [MonoTODO]
71                 protected override void SetDesignModeState (IDictionary data)
72                 {
73                         EditorZoneBase stateZone = data["Zone"] as EditorZoneBase;
74                         if(stateZone != null)
75                                 zone = stateZone;
76                 }
77 #endif
78                 public abstract void SyncChanges ();
79
80                 [Browsable (false)]
81                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
82                 public virtual bool Display {
83                         get { 
84                                 return display;
85                         }
86                 }
87
88                 [Browsable (false)]
89                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
90                 public string DisplayTitle {
91                         get { return displayTitle; }
92                 }
93
94 #if false
95                 protected WebPartManager WebPartManager {
96                         get { throw new NotImplementedException (); }
97                 }
98 #endif
99
100                 protected WebPart WebPartToEdit {
101                         get { return webPartToEdit; }
102                 }
103
104 #if false
105                 protected EditorZoneBase Zone {
106                         get { throw new NotImplementedException (); }
107                 }
108 #endif
109         }
110 }
111
112 #endif