private void updateUsername() { Rater user = RaterSaved.GetRater(); if (user != null && FindViewById <AppCompatTextView>(Resource.Id.userName) != null) { FindViewById <AppCompatTextView>(Resource.Id.userName).SetText(user.Name.ToCharArray(), 0, user.Name.Length); } }
public async static void Init(Action callback) { var ret = await Storage.GetRater(); if (ret != null) { raterr = ret; } callback?.Invoke(); }
public static void SetRater(Rater rater) { try { _ = SecureStorage.SetAsync("ShishaBacon_Rater", JsonConvert.SerializeObject(rater, Formatting.Indented)); } catch (Exception) { // Possible that device doesn't support secure storage on device. } }
public int GetOwnRating() { Rater me = RaterSaved.GetRater(); foreach (Rating rat in ratings) { if (rat.rater.Equals(me)) { return(rat.Value); } } return(-1); }
public Rating(Rater rater, int rating) { this.rater = rater; this.value = rating; }
public static void SetRater(Rater rater) { raterr = rater; Storage.SetRater(raterr); }