(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / System.Windows.Forms / System.Windows.Forms.Design / ComponentEditorPage.cs
blob0d288ad930d6591e8485ab164df7a77f61f234d3
1 //
2 // System.Windows.Forms.Design.ComponentEditorPage.cs
3 //
4 // Author:
5 // Andreas Nahr (ClassDevelopment@A-SoftTech.com)
6 //
8 using System.ComponentModel;
9 using System.Drawing;
11 namespace System.Windows.Forms.Design
13 public abstract class ComponentEditorPage : Panel
15 private bool commitOnDeactivate = false;
16 private IComponent component;
17 private bool firstActivate = true;
18 private Icon icon;
19 private int loading = 0;
20 private bool loadRequired = false;
21 private IComponentEditorPageSite pageSite;
23 public ComponentEditorPage ()
27 public bool CommitOnDeactivate {
28 get { return commitOnDeactivate; }
29 set { commitOnDeactivate = value; }
32 protected IComponent Component {
33 get { return component; }
34 set { component = value; }
37 [MonoTODO ("Find out what this does.")]
38 protected override CreateParams CreateParams {
39 get {
40 throw new NotImplementedException ();
44 protected bool FirstActivate {
45 get { return firstActivate; }
46 set { firstActivate = value; }
49 public Icon Icon {
50 get { return icon; }
51 set { icon = value; }
54 protected int Loading {
55 get { return loading; }
56 set { loading = value; }
59 protected bool LoadRequired {
60 get { return loadRequired; }
61 set { loadRequired = value; }
64 protected IComponentEditorPageSite PageSite {
65 get { return pageSite; }
66 set { pageSite = value; }
69 public virtual string Title {
70 get { return base.Text; }
73 public virtual void Activate ()
75 Visible = true;
76 firstActivate = false;
77 if (loadRequired) {
78 EnterLoadingMode ();
79 LoadComponent ();
80 ExitLoadingMode ();
84 public virtual void ApplyChanges ()
86 SaveComponent ();
89 public virtual void Deactivate ()
91 Visible = false;
94 protected void EnterLoadingMode ()
96 loading++;
99 protected void ExitLoadingMode ()
101 loading--;
104 public virtual Control GetControl ()
106 return this;
109 protected IComponent GetSelectedComponent ()
111 return component;
114 protected bool IsFirstActivate ()
116 return firstActivate;
119 protected bool IsLoading ()
121 return (loading != 0);
124 public virtual bool IsPageMessage (ref Message msg)
126 return PreProcessMessage (ref msg);
129 protected abstract void LoadComponent ();
131 [MonoTODO ("Find out what this does.")]
132 public virtual void OnApplyComplete ()
136 protected virtual void ReloadComponent ()
138 loadRequired = true;
141 protected abstract void SaveComponent ();
143 public virtual void SetComponent (IComponent component)
145 this.component = component;
146 ReloadComponent ();
149 [MonoTODO ("Find out what this does.")]
150 protected virtual void SetDirty ()
154 public virtual void SetSite (IComponentEditorPageSite site)
156 pageSite = site;
157 pageSite.GetControl ().Controls.Add (this);
161 public virtual void ShowHelp ()
165 public virtual bool SupportsHelp ()
167 return false;