Improved differentiating office icons, the actual application has a different icon as the "document". For Outlook this is even different for the email & meeting.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1666 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-02-20 12:13:59 +00:00
commit be0569bb21
8 changed files with 117 additions and 47 deletions

View file

@ -39,14 +39,16 @@ namespace Greenshot.Destinations {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ExcelDestination));
private static CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
private static string exePath = null;
private static Image icon = null;
private static Image applicationIcon = null;
private static Image workbookIcon = null;
private ILanguage lang = Language.GetInstance();
private string workbookName = null;
static ExcelDestination() {
exePath = GetExePath("EXCEL.EXE");
if (exePath != null && File.Exists(exePath)) {
icon = GetExeIcon(exePath);
applicationIcon = GetExeIcon(exePath, 0);
workbookIcon = GetExeIcon(exePath, 1);
} else {
exePath = null;
}
@ -70,7 +72,7 @@ namespace Greenshot.Destinations {
if (workbookName == null) {
return "Microsoft Excel";
} else {
return "Microsoft Excel - " + workbookName;
return workbookName;
}
}
}
@ -95,7 +97,10 @@ namespace Greenshot.Destinations {
public override Image DisplayIcon {
get {
return icon;
if (!string.IsNullOrEmpty(workbookName)) {
return workbookIcon;
}
return applicationIcon;
}
}