using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Component.All
{
///
/// Class is passed into ISetup ComponentLoaded() giving each component
/// a chance to subscribe to it
///
public class SetupEvents
{
#region Events
///
/// Delegate used to handle Setup Events
///
public delegate void SetupEvent();
///
/// Called after the entire Setup Application ends
///
public event SetupEvent Ending_Setup;
///
/// Called before the entire Install Process Begins
///
public event SetupEvent Before_Install;
///
/// Called after the entire Install Process ends
///
public event SetupEvent After_Install;
///
/// Called before the entire Uninstall Process Begins
///
public event SetupEvent Before_Uninstall;
///
/// Called after the entire Uninstall Process ends
///
public event SetupEvent After_Uninstall;
#endregion
# region Event Raisers
///
/// Raise the Ending Setup Event
///
public void Raise_Ending_Setup_Event()
{
if (Ending_Setup != null)
Ending_Setup();
}
///
/// Raise the Before Install Event
///
public void Raise_Before_Install_Event()
{
if (Before_Install != null)
Before_Install();
}
///
/// Raise the After Install Event
///
public void Raise_After_Install_Event()
{
if (After_Install != null)
After_Install();
}
///
/// Raise the Before Uninstall Event
///
public void Raise_Before_Uninstall_Event()
{
if (Before_Uninstall != null)
Before_Uninstall();
}
///
/// Raise the After Uninstall Event
///
public void Raise_After_Uninstall_Event()
{
if (After_Uninstall != null)
After_Uninstall();
}
#endregion
}
///
/// All Components that install themselves will implement this interface, if they are interested to
/// listen to / Handle Setup Events
///
public interface ISetup
{
///
/// Called when the Component is loaded. Components are only loaded
/// when an Install on them is iminent. The component has a chance to
/// listen to/handle events in the setup process.
///
void ComponentLoaded(ref SetupEvents subscribeToDesiredEvents);
}
}