Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasReitberger committed Jan 2, 2023
2 parents 1324e29 + 2e59762 commit 64f0547
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions source/MauiSettings/MauiSettings/MauiSettingsGeneric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ List<MauiSettingAttribute> settingBaseAttributes
MauiSettingsHelper.SetSettingsValue(settingsInfo.Name, settingsInfo.Value);
}
break;
}
}
break;
case MauiSettingsActions.Delete:
object fallbackValue = MauiSettingsObjectHelper.GetDefaultValue(settingBaseAttribute, settingsInfo.SettingsType);
Expand Down Expand Up @@ -552,7 +552,7 @@ List<MauiSettingAttribute> settingBaseAttributes
MauiSettingsHelper.SetSettingsValue(settingsInfo.Name, settingsInfo.Value);
}
break;
}
}
break;
case MauiSettingsActions.LoadDefaults:
object defaulSettingtValue = MauiSettingsObjectHelper.GetDefaultValue(settingBaseAttribute, settingsInfo.SettingsType);
Expand Down Expand Up @@ -594,7 +594,7 @@ List<MauiSettingAttribute> settingBaseAttributes
}
return true;
}
#endregion
#endregion

#endregion
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public static void SetValue<T>(string key, T value, bool synchronize = true)
// Maximum key size - Key names cannot be longer than 64 bytes.
// Maximum value size - You cannot store more than 64 kilobytes in a single value.
long size = key?.Length ?? 0 * sizeof(char);
if(size > LimitKey)
if (size > LimitKey)
{
throw new ArgumentOutOfRangeException($"The size of the key '{key}' exceeds the limit of '{LimitKey}' (current size is '{size}')!");
}
if(value is string valueString)
if (value is string valueString)
{
size = valueString.Length * sizeof(char);
if (size > LimitKey)
Expand All @@ -43,14 +43,14 @@ public static void SetValue<T>(string key, T value, bool synchronize = true)
}

Store?.SetString(key, valueString); // key and value
if(synchronize)
if (synchronize)
Store?.Synchronize();
}
}

public static void SeString(string key, string value, bool synchronize = true)
{
SetValue(key, value, synchronize);
SetValue(key, value, synchronize);
}

public static void DeleteValue(string key, bool synchronize = true)
Expand Down

0 comments on commit 64f0547

Please sign in to comment.