Exemple #1
0
        public NewAlert()
        {
            try {
                locationHandler.getLocation();
            } catch (FeatureNotSupportedException fnsEx) {
                DisplayAlert("Error", "Feature not supported on device", "OK");
            } catch (FeatureNotEnabledException fneEx) {
                DisplayAlert("Error", "Feature not enabled on device", "OK");
            } catch (PermissionException pEx) {
                DisplayAlert("Error", "Permissions not granted", "OK");
            } catch (Exception ex) {
                DisplayAlert("Error", "Unknown error, details:\n" + ex.Message, "OK");
            }

            Content    = BuildContent();
            alertTypes = c.getAlertTypeDescriptions();

            if (c.getLightMode())
            {
                BackgroundColor = Color.White;
            }
            else
            {
                BackgroundColor = Color.FromHex("282828");
            }
        }
Exemple #2
0
        public EditAlert()
        {
            Content    = BuildContent();
            alertTypes = c.getAlertTypeDescriptions();

            if (c.getLightMode())
            {
                BackgroundColor = Color.White;
            }
            else
            {
                BackgroundColor = Color.FromHex("282828");
            }
        }
Exemple #3
0
        public static string getAlertTypeNameFromID(int alertTypeID)
        {
            alertTypeID++; //Add one to match server
            ControlVars   c          = new ControlVars();
            List <string> alertTypes = c.getAlertTypeDescriptions();

            return(alertTypes[alertTypeID]);
        }
Exemple #4
0
        public DrivingMode()
        {
            NavigationPage.SetHasNavigationBar(this, false);
            Content    = BuildContent();
            alertTypes = c.getAlertTypeDescriptions();

            if (c.getLightMode())
            {
                BackgroundColor = Color.White;
            }
            else
            {
                BackgroundColor = Color.FromHex("282828");
            }
        }
Exemple #5
0
        public static int getAlertTypeIDFromName(string alertTypeName)
        {
            ControlVars   c          = new ControlVars();
            List <string> alertTypes = c.getAlertTypeDescriptions();
            int           index      = 1;

            foreach (string s in alertTypes)
            {
                if (s.Equals(alertTypeName))
                {
                    return(index);
                }
                else
                {
                    index++;
                }
            }
            //If not found
            return(-1);
        }