예제 #1
0
        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));
        }
예제 #2
0
        public static DateTimeOffset LastLaunchedTime()
        {
            if (!Storage.HasKey(Key_LastLaunchedAt))
            {
                return(DateTime.Now);
            }
            var str = Storage.GetString(Key_LastLaunchedAt);

            return(DateTimeOffset.Parse(str));
        }
예제 #3
0
 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;
예제 #5
0
 public bool IsUnauthorized(string apiToken)
 => apiToken == keyValueStorage.GetString(unauthorizedAccessKey);
예제 #6
0
 public static RatingViewConfiguration ReadStoredRatingViewConfiguration(this IKeyValueStorage keyValueStorage)
 => new RatingViewConfiguration(
     keyValueStorage.GetInt(RemoteConfigKeys.RatingViewDelayParameter, 5),
     (keyValueStorage.GetString(RemoteConfigKeys.RatingViewTriggerParameter) ?? string.Empty).ToRatingViewCriterion());
예제 #7
0
 public void Upsert_String()
 {
     kvs.Upsert(key, "hogehoge");
     Assert.AreEqual("hogehoge", kvs.GetString(key));
 }