[System.Web.Extensions] Update default profile and remove old profiles files
[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
31 using System.Collections;
32 using System.ComponentModel;
33
34 namespace System.Web.UI.WebControls.WebParts
35 {
36
37         [BindableAttribute(false)]
38         [Designer ("System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
39         public abstract class EditorPart : Part
40         {       
41                 bool                            display = true;
42 #pragma warning disable 0649
43                 WebPart                         webPartToEdit;
44 #if false
45                 WebPartManager          manager;
46                 EditorZoneBase          zone;
47 #endif
48                 object zone;
49                 string                          displayTitle;
50 #pragma warning restore 0649
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                 protected override void SetDesignModeState (IDictionary data)
71                 {
72                         EditorZoneBase stateZone = data["Zone"] as EditorZoneBase;
73                         if(stateZone != null)
74                                 zone = stateZone;
75                 }
76 #endif
77                 public abstract void SyncChanges ();
78
79                 [Browsable (false)]
80                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
81                 public virtual bool Display {
82                         get { 
83                                 return display;
84                         }
85                 }
86
87                 [Browsable (false)]
88                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
89                 public string DisplayTitle {
90                         get { return displayTitle; }
91                 }
92
93 #if false
94                 protected WebPartManager WebPartManager {
95                         get { throw new NotImplementedException (); }
96                 }
97 #endif
98
99                 protected WebPart WebPartToEdit {
100                         get { return webPartToEdit; }
101                 }
102
103 #if false
104                 protected EditorZoneBase Zone {
105                         get { throw new NotImplementedException (); }
106                 }
107 #endif
108         }
109 }
110