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

            if (ret != null)
            {
                raterr = ret;
            }
            callback?.Invoke();
        }
Ejemplo 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.
     }
 }
Ejemplo 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);
        }
Ejemplo n.º 5
0
 public Rating(Rater rater, int rating)
 {
     this.rater = rater;
     this.value = rating;
 }
Ejemplo n.º 6
0
 public static void SetRater(Rater rater)
 {
     raterr = rater;
     Storage.SetRater(raterr);
 }