mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Fixed problems in the designer with the last changes, also added some future code which is disabled. And uncommented the "Greenshot-filetype" registration in the installer.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2375 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
3115c927b7
commit
e11450f56f
7 changed files with 161 additions and 17 deletions
|
@ -20,7 +20,6 @@
|
|||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Reflection;
|
||||
using GreenshotPlugin.Core;
|
||||
|
@ -30,8 +29,12 @@ using System.ComponentModel.Design;
|
|||
using System.IO;
|
||||
|
||||
namespace GreenshotPlugin.Controls {
|
||||
public abstract class GreenshotForm : AnimatingForm, IGreenshotLanguageBindable {
|
||||
/// <summary>
|
||||
/// This form is used for automatically binding the elements of the form to the language
|
||||
/// </summary>
|
||||
public class GreenshotForm : Form, IGreenshotLanguageBindable {
|
||||
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(GreenshotForm));
|
||||
protected static CoreConfiguration coreConfiguration;
|
||||
private static IDictionary<Type, FieldInfo[]> reflectionCache = new Dictionary<Type, FieldInfo[]>();
|
||||
private IComponentChangeService m_changeService;
|
||||
private bool isDesignModeLanguageSet = false;
|
||||
|
@ -40,12 +43,31 @@ namespace GreenshotPlugin.Controls {
|
|||
private IDictionary<string, Control> designTimeControls;
|
||||
private IDictionary<string, ToolStripItem> designTimeToolStripItems;
|
||||
|
||||
static GreenshotForm() {
|
||||
if (!IsInDesignMode) {
|
||||
coreConfiguration = IniConfig.GetIniSection<CoreConfiguration>();
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
|
||||
public string LanguageKey {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to check the designmode during a constructor
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected static bool IsInDesignMode {
|
||||
get {
|
||||
if (Application.ExecutablePath.IndexOf("devenv.exe", StringComparison.OrdinalIgnoreCase) > -1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected bool ManualLanguageApply {
|
||||
get {
|
||||
return applyLanguageManually;
|
||||
|
@ -64,13 +86,6 @@ 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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue