Refactored the ini code to be more "OO", making it possible to reset a value which was needed to implement an auto-repair for certain settings. This was intiated by Bug #3509754, which hat the reason that somehow the Hotkey name was corrupt.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1721 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-03-22 12:00:07 +00:00
commit 4b3f7ba0a5
10 changed files with 507 additions and 440 deletions

View file

@ -194,7 +194,8 @@ namespace GreenshotPlugin.Core {
if (productName != null && NoDWMCaptureForProduct.Contains(productName.ToLower())) {
return false;
}
} catch {
} catch (Exception ex) {
LOG.Warn(ex);
}
}
}
@ -214,7 +215,8 @@ namespace GreenshotPlugin.Core {
if (productName != null && NoGDICaptureForProduct.Contains(productName.ToLower())) {
return false;
}
} catch {
} catch (Exception ex) {
LOG.Warn(ex);
}
}
}
@ -250,7 +252,8 @@ namespace GreenshotPlugin.Core {
try {
Directory.CreateDirectory(pafOutputFilePath);
return pafOutputFilePath;
} catch(Exception) {
} catch (Exception ex) {
LOG.Warn(ex);
// Problem creating directory, fallback to Desktop
}
} else {

View file

@ -48,7 +48,8 @@ namespace GreenshotPlugin.Core {
}
}
}
} catch {
} catch (Exception ex) {
LOG.Warn(ex);
}
}
return list;

View file

@ -244,7 +244,7 @@ namespace GreenshotPlugin.Core {
return iconCache[filename];
} catch (Exception ex) {
LOG.WarnFormat("Couldn't get icon for window {0} due to: {1}", Text, ex.Message);
};
}
return null;
}
}
@ -567,7 +567,9 @@ namespace GreenshotPlugin.Core {
if (process != null) {
return process;
}
} catch {}
} catch (Exception ex) {
LOG.Warn(ex);
}
return null;
}
}
@ -1358,7 +1360,9 @@ namespace GreenshotPlugin.Core {
get {
try {
return "Greenshot".Equals(Process.MainModule.FileVersionInfo.ProductName);
} catch {}
} catch (Exception ex) {
LOG.Warn(ex);
}
return false;
}
}