copied mono-api-diff.cs from mono-2-2 branch so new patch can be applied and history...
[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 #pragma warning disable 0649
44                 WebPart                         webPartToEdit;
45 #if false
46                 WebPartManager          manager;
47                 EditorZoneBase          zone;
48 #endif
49                 object zone;
50                 string                          displayTitle;
51 #pragma warning restore 0649
52
53                 protected EditorPart() {}
54
55                 public abstract bool ApplyChanges ();
56
57                 protected override IDictionary GetDesignModeState ()
58                 {
59                         throw new NotImplementedException ();
60                 }
61
62                 protected internal override void OnPreRender (EventArgs e)
63                 {
64                         if(zone ==  null)
65                                 throw new InvalidOperationException();
66                         base.OnPreRender(e);
67                         if(!Display)
68                                 Visible = false;
69                 }
70 #if false
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