static Guid GetGuid(string key) { var value = Preferences2.Get(key, null); if (!(!string.IsNullOrWhiteSpace(value) && ShortGuid.TryParse(value, out Guid guid))) { guid = Guid.NewGuid(); Preferences2.Set(key, guid.ToStringS()); } return(guid); }
static string Get(string key) { var value = Preferences2.Get(key, null); if (string.IsNullOrWhiteSpace(value)) { value = Random2.GenerateRandomString(DeviceIdRLength, _Constants.DigitsLetters); Preferences2.Set(key, value); } return(value); }
static string[] ReadHistory(string key) => Preferences2.Get(key, null, sharedName)?.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries) ?? new string[0];