mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 10:47:02 -07:00
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:
parent
a9fd39fd45
commit
ede5bfef97
8 changed files with 85 additions and 52 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue