Exemplo n.º 1
0
        public async Task <string> GetSavedUsername()
        {
            string username = null;

            try
            {
                username = await BlobCache.UserAccount.GetObject <string>("username");
            }
            catch (Exception e)
            {
                AnalyticsHelpers.LogWarning("Username Not Found", e.Message, e);
            }

            return(username);
        }
Exemplo n.º 2
0
        public bool IsOperatingSystemSupported(int majorVersion, int minorVersion)
        {
            try
            {
                double sdkInt;
                double.TryParse(Build.VERSION.Release, out sdkInt);

                return(sdkInt >= (majorVersion + minorVersion * .1));
            }
            catch (Exception e)
            {
                AnalyticsHelpers.LogWarning("Operating System Check Failed", e.Message, e);
                return(false);
            }
        }
Exemplo n.º 3
0
        public async Task <bool> CheckLogin(string username, string password)
        {
            string _username = null;
            string _password = null;

            try
            {
                _username = await BlobCache.UserAccount.GetObject <string>("username");
            }
            catch (Exception e)
            {
                AnalyticsHelpers.LogWarning("No Username Stored", e.Message, e);
                return(false);
            }

            try
            {
                _password = await BlobCache.UserAccount.GetObject <string>("password");
            }
            catch (Exception e)
            {
                AnalyticsHelpers.LogWarning("No Password Store", e.Message, e);
                return(false);
            }

            try
            {
                IEnumerable <string> test = await BlobCache.UserAccount.GetAllKeys();
            }
            catch (Exception e)
            {
                AnalyticsHelpers.LogWarning("Error Getting User Account Keys", e.Message, e);
            }

            if (_username == null || _password == null)
            {
                return(false);
            }

            if (password == _password &&
                username == _username.ToString())
            {
                return(true);
            }

            return(false);
        }