Cleanup of the AboutForm, changed the Style to a "FixedToolWindow", I find this more professional. Changed the AnimatingForm to have a flag, EnableAnimation, which is false by default and makes it possible to make the Form the base form of all GreenshotForm forms. Renamed the conf -> coreConfiguration, as this is already in the base class. Also added some comments.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2367 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-12-07 16:31:20 +00:00
commit 57e4a8dd73
9 changed files with 89 additions and 33 deletions

View file

@ -33,6 +33,14 @@ namespace GreenshotPlugin.Controls {
private int vRefresh = 0;
private Timer timer = null;
/// <summary>
/// This flag specifies if any animation is used
/// </summary>
protected bool EnableAnimation {
get;
set;
}
/// <summary>
/// Vertical Refresh Rate
/// </summary>
@ -74,12 +82,13 @@ namespace GreenshotPlugin.Controls {
/// Initialize the animation
/// </summary>
protected AnimatingForm() {
timer = new Timer();
timer.Interval = 1000 / VRefresh;
timer.Tick += new EventHandler(timer_Tick);
this.Load += delegate {
timer.Start();
if (EnableAnimation) {
timer = new Timer();
timer.Interval = 1000 / VRefresh;
timer.Tick += new EventHandler(timer_Tick);
timer.Start();
}
};
// Unregister at close

View file

@ -30,7 +30,7 @@ using System.ComponentModel.Design;
using System.IO;
namespace GreenshotPlugin.Controls {
public abstract class GreenshotForm : Form, IGreenshotLanguageBindable {
public abstract class GreenshotForm : AnimatingForm, IGreenshotLanguageBindable {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(GreenshotForm));
private static IDictionary<Type, FieldInfo[]> reflectionCache = new Dictionary<Type, FieldInfo[]>();
private IComponentChangeService m_changeService;
@ -64,6 +64,13 @@ namespace GreenshotPlugin.Controls {
}
}
/// <summary>
/// Normally a Greenshot form doesn't animate
/// </summary>
protected override void Animate() {
throw new NotImplementedException();
}
/// <summary>
/// Code to initialize the language etc during design time
/// </summary>