FEATURE-945: Added environment variables to the external command (also removed unused imports and made some variables readonly)

This commit is contained in:
Robin 2016-05-20 23:43:31 +02:00
parent 4f326c9c0e
commit d25021631e
90 changed files with 390 additions and 373 deletions

View file

@ -110,12 +110,15 @@ namespace GreenshotPlugin.Core {
public static Image GetCachedExeIcon(string path, int index) {
string cacheKey = string.Format("{0}:{1}", path, index);
Image returnValue;
if (!exeIconCache.TryGetValue(cacheKey, out returnValue)) {
lock (exeIconCache) {
if (!exeIconCache.TryGetValue(cacheKey, out returnValue)) {
returnValue = GetExeIcon(path, index);
if (returnValue != null) {
exeIconCache.Add(cacheKey, returnValue);
lock (exeIconCache)
{
if (!exeIconCache.TryGetValue(cacheKey, out returnValue)) {
lock (exeIconCache) {
if (!exeIconCache.TryGetValue(cacheKey, out returnValue)) {
returnValue = GetExeIcon(path, index);
if (returnValue != null) {
exeIconCache.Add(cacheKey, returnValue);
}
}
}
}