using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using WindowsFormsAero.Dwm;
using System.Drawing;
namespace OnTopReplica {
///
/// Represents a side panel that can be embedded in OnTopReplica.
///
class SidePanel : UserControl {
public SidePanel() {
this.FixDefaultFont();
}
protected override void OnCreateControl() {
if (!DesignMode) {
Dock = DockStyle.Fill;
}
base.OnCreateControl();
}
///
/// Gets the panel's parent form.
///
protected MainForm ParentMainForm { get; private set; }
///
/// Raised when the side panel requests to be closed.
///
public event EventHandler RequestClosing;
protected virtual void OnRequestClosing() {
var evt = RequestClosing;
if (evt != null)
evt(this, EventArgs.Empty);
}
///
/// Is called when the side panel is embedded and first shown.
///
/// Parent form that is embedding the side panel.
public virtual void OnFirstShown(MainForm form) {
ParentMainForm = form;
}
///
/// Is called before removing the side panel.
///
/// Parent form that is embedding the side panel.
public virtual void OnClosing(MainForm form) {
}
///
/// Gets the side panel's title.
///
public virtual string Title {
get {
return "Side panel";
}
}
///
/// Gets the panel's desired glass margins or null if no glass surface is required.
///
public virtual Margins? GlassMargins {
get {
return null;
}
}
}
}