1 // System.Configuration.Install.Installer.cs
4 // Alejandro Sánchez Acosta <raciel@es.gnu.org>
6 // Alejandro Sánchez Acosta
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:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
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.
30 using System.Collections;
31 using System.ComponentModel;
32 using System.ComponentModel.Design;
34 namespace System.Configuration.Install
36 [DefaultEvent("AfterInstall")]
37 public class Installer : Component
39 private InstallContext context;
40 private string helptext;
41 private InstallerCollection installers;
42 internal Installer parent;
47 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
48 [BrowsableAttribute(false)]
49 public InstallContext Context {
59 public virtual string HelpText {
65 public InstallerCollection Installers {
71 public Installer Parent {
81 public virtual void Commit (IDictionary savedState)
85 public virtual void Install (IDictionary stateSaver)
89 protected virtual void OnAfterInstall (IDictionary savedState)
91 if (AfterInstall != null)
92 AfterInstall (this, new InstallEventArgs (savedState));
95 protected virtual void OnAfterRollback (IDictionary savedState)
97 if (AfterRollback != null)
98 AfterRollback (this, new InstallEventArgs (savedState));
101 protected virtual void OnAfterUninstall (IDictionary savedState)
103 if (AfterUninstall != null)
104 AfterUninstall (this, new InstallEventArgs (savedState));
107 protected virtual void OnBeforeInstall (IDictionary savedState)
109 if (BeforeInstall != null)
110 BeforeInstall (this, new InstallEventArgs (savedState));
113 protected virtual void OnBeforeRollback (IDictionary savedState)
115 if (BeforeRollback != null)
116 BeforeRollback (this, new InstallEventArgs (savedState));
119 protected virtual void OnBeforeUninstall (IDictionary savedState)
121 if (BeforeUninstall != null)
122 BeforeUninstall (this, new InstallEventArgs (savedState));
125 protected virtual void OnCommitted (IDictionary savedState)
127 if (Committed != null)
128 Committed (this, new InstallEventArgs (savedState));
131 protected virtual void OnCommitting (IDictionary savedState)
133 if (Committing != null)
134 Committing (this, new InstallEventArgs (savedState));
137 public virtual void Rollback (IDictionary savedState)
141 public virtual void Uninstall (IDictionary savedState)
145 public event InstallEventHandler AfterInstall;
147 public event InstallEventHandler AfterRollback;
149 public event InstallEventHandler AfterUninstall;
151 public event InstallEventHandler BeforeInstall;
153 public event InstallEventHandler BeforeRollback;
155 public event InstallEventHandler BeforeUninstall;
157 public event InstallEventHandler Committed;
159 public event InstallEventHandler Committing;