Added icons to the external commands editor & added a check for the OK button

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1746 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-04-04 12:09:33 +00:00
commit cdba70d227
8 changed files with 109 additions and 22 deletions

View file

@ -36,7 +36,6 @@ namespace ExternalCommand {
public class ExternalCommandDestination : AbstractDestination {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ExternalCommandDestination));
private static ExternalCommandConfiguration config = IniConfig.GetIniSection<ExternalCommandConfiguration>();
private static Dictionary<string, Image> iconCache = new Dictionary<string, Image>();
private IGreenshotHost host;
private string presetCommand;
@ -69,20 +68,7 @@ namespace ExternalCommand {
public override Image DisplayIcon {
get {
if (presetCommand != null) {
if (!iconCache.ContainsKey(presetCommand)) {
Image icon = null;
if (File.Exists(config.commandlines[presetCommand])) {
try {
icon = GetExeIcon(config.commandlines[presetCommand], 0);
} catch{};
}
iconCache.Add(presetCommand, icon);
}
return iconCache[presetCommand];
} else {
return null;
}
return IconCache.IconForExe(presetCommand);
}
}