BUG-1894: Postponing history loading as long as possible, this reduces the Imgur activity dramatically (as it's not loaded during start) and should at least prevent a 429 early on... hopefully. It would be better to cache everything locally on the user's PC, but this is unrealistic with .NET 2.0 technology (not impossible, but so time consuming that it would be better to wait for the next Greenshot version with 4.5).

This commit is contained in:
Robin 2016-11-16 09:09:28 +01:00
commit ede5bfef97
8 changed files with 85 additions and 52 deletions

View file

@ -353,6 +353,20 @@ namespace Greenshot.IniFile {
return null;
}
// The following makes the enum string values a bit less restrictive
if (valueType.IsEnum)
{
string searchingEnumString = valueString.Replace("_", "").ToLowerInvariant();
foreach (var possibleValue in Enum.GetValues(valueType))
{
var possibleString = possibleValue.ToString().Replace("_", "").ToLowerInvariant();
if (possibleString.Equals(searchingEnumString))
{
return possibleValue;
}
}
}
if (valueType.IsGenericType && valueType.GetGenericTypeDefinition() == typeof(List<>)) {
string arraySeparator = separator;
object list = Activator.CreateInstance(valueType);