Exemple #1
0
        public async static Task <bool> Execute(Action action)
        {
            var result = await Task.Run(() =>
            {
                using (var sessionContext = GeoUsersServices.SessionProvider.GetSessionContextBlock())
                {
                    try
                    {
                        action();

                        return(true);
                    }
                    catch (Exception e)
                    {
                        Logger.Log(e);

                        sessionContext.ExceptionThrown = true;

                        MessageBoxUtils.Error(e.Message);

                        return(false);
                    }
                }
            });

            return(result);
        }
Exemple #2
0
        public static bool ValidateCoordinates(string coordinates)
        {
            double result;

            var isValid = Double.TryParse(coordinates, out result);

            if (!isValid)
            {
                MessageBoxUtils.Error("Las coordenadas ingresadas son invalidas.\nDeben ingresarse en valor decimal: (-)xx.xx");
            }

            return(isValid);
        }