mirror of
https://github.com/LorenzCK/OnTopReplica.git
synced 2024-05-21 04:43:55 +12:00
56e47fb7e5
Some code clean-up.
74 lines
2 KiB
C#
74 lines
2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using WindowsFormsAero.Dwm;
|
|
using System.Drawing;
|
|
|
|
namespace OnTopReplica {
|
|
|
|
/// <summary>
|
|
/// Represents a side panel that can be embedded in OnTopReplica.
|
|
/// </summary>
|
|
class SidePanel : UserControl {
|
|
|
|
protected override void OnCreateControl() {
|
|
if (!DesignMode) {
|
|
Dock = DockStyle.Fill;
|
|
}
|
|
|
|
base.OnCreateControl();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the panel's parent form.
|
|
/// </summary>
|
|
protected MainForm ParentMainForm { 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) {
|
|
ParentMainForm = 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) {
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the side panel's title.
|
|
/// </summary>
|
|
public virtual string Title {
|
|
get {
|
|
return "Side panel";
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the panel's desired glass margins or null if no glass surface is required.
|
|
/// </summary>
|
|
public virtual Margins? GlassMargins {
|
|
get {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|