Exemple #1
0
        public SecureStorageResult Remove(string key)
        {
            var result = new SecureStorageResult();

            try
            {
                result.IsSuccessful = Xamarin.Essentials.SecureStorage.Remove(key);
            }
            catch (Exception e)
            {
                result.Message = e.Message;
            }

            return(result);
        }
Exemple #2
0
        public SecureStorageResult Clear()
        {
            var result = new SecureStorageResult();

            try
            {
                Xamarin.Essentials.SecureStorage.RemoveAll();
                result.IsSuccessful = true;
            }
            catch (Exception e)
            {
                result.Message = e.Message;
            }

            return(result);
        }
Exemple #3
0
        public async Task <SecureStorageResult> GetAsync(string key)
        {
            var result = new SecureStorageResult();

            try
            {
                result.Value = await Xamarin.Essentials.SecureStorage.GetAsync(key);

                result.IsSuccessful = result.Value != null;
            }
            catch (Exception e)
            {
                result.Message = e.Message;
            }

            return(result);
        }
Exemple #4
0
        public async Task <SecureStorageResult> SetAsync(string key, string value)
        {
            var result = new SecureStorageResult();

            try
            {
                await Xamarin.Essentials.SecureStorage.SetAsync(key, value);

                result.IsSuccessful = true;
            }
            catch (Exception e)
            {
                result.Message = e.Message;
            }

            return(result);
        }