OnTopReplica/OnTopReplica/SidePanel.cs
Lorenz Cuno Klopfenstein 78917c9c12 Added modular Side Panel system.
Refactored region selection box as Side Panel implementation.
Added icons to region selection panel.
2010-06-30 22:02:04 +02:00

50 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace OnTopReplica {
/// <summary>
/// Represents a side panel that can be embedded in OnTopReplica.
/// </summary>
class SidePanel : UserControl {
public SidePanel() {
Dock = DockStyle.Fill;
}
/// <summary>
/// Gets the panel's parent form.
/// </summary>
protected MainForm ParentForm { get; private set; }
/// <summary>
/// Raised when the side panel requests to be closed.
/// </summary>
public event EventHandler RequestClosing;
protected virtual void OnRequestClosing() {
var evt = RequestClosing;
if (evt != null)
evt(this, EventArgs.Empty);
}
/// <summary>
/// Is called when the side panel is embedded and first shown.
/// </summary>
/// <param name="form">Parent form that is embedding the side panel.</param>
public virtual void OnFirstShown(MainForm form) {
ParentForm = form;
}
/// <summary>
/// Is called before removing the side panel.
/// </summary>
/// <param name="form">Parent form that is embedding the side panel.</param>
public virtual void OnClosing(MainForm form) {
}
}
}