public static DateTime GetDate(this IKeyValueStorage self, string key, out bool ok) { var v = self.GetString(key); long bin; ok = long.TryParse(v, out bin); return(DateTime.FromBinary(bin)); }
public static DateTimeOffset LastLaunchedTime() { if (!Storage.HasKey(Key_LastLaunchedAt)) { return(DateTime.Now); } var str = Storage.GetString(Key_LastLaunchedAt); return(DateTimeOffset.Parse(str)); }
public override string GetString(string key, string defaultValue = "") { return(delegator.GetString(key, defaultValue)); }
public bool HasUserDataStored() => !string.IsNullOrEmpty(keyValueStorage.GetString(apiTokenKey)) && keyValueStorage.GetLong(userIdKey, -1L) != -1;
public bool IsUnauthorized(string apiToken) => apiToken == keyValueStorage.GetString(unauthorizedAccessKey);
public static RatingViewConfiguration ReadStoredRatingViewConfiguration(this IKeyValueStorage keyValueStorage) => new RatingViewConfiguration( keyValueStorage.GetInt(RemoteConfigKeys.RatingViewDelayParameter, 5), (keyValueStorage.GetString(RemoteConfigKeys.RatingViewTriggerParameter) ?? string.Empty).ToRatingViewCriterion());
public void Upsert_String() { kvs.Upsert(key, "hogehoge"); Assert.AreEqual("hogehoge", kvs.GetString(key)); }