Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        public async static void Init(Action callback)
        {
            var ret = await Storage.GetRater();

            if (ret != null)
            {
                raterr = ret;
            }
            callback?.Invoke();
        }
Esempio n. 3
0
 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.
     }
 }
Esempio n. 4
0
        public int GetOwnRating()
        {
            Rater me = RaterSaved.GetRater();

            foreach (Rating rat in ratings)
            {
                if (rat.rater.Equals(me))
                {
                    return(rat.Value);
                }
            }
            return(-1);
        }
Esempio n. 5
0
 public Rating(Rater rater, int rating)
 {
     this.rater = rater;
     this.value = rating;
 }
Esempio n. 6
0
 public static void SetRater(Rater rater)
 {
     raterr = rater;
     Storage.SetRater(raterr);
 }