示例#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");
            }
        }
示例#2
0
        public EditAlert()
        {
            Content    = BuildContent();
            alertTypes = c.getAlertTypeDescriptions();

            if (c.getLightMode())
            {
                BackgroundColor = Color.White;
            }
            else
            {
                BackgroundColor = Color.FromHex("282828");
            }
        }
示例#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]);
        }
示例#4
0
        public DrivingMode()
        {
            NavigationPage.SetHasNavigationBar(this, false);
            Content    = BuildContent();
            alertTypes = c.getAlertTypeDescriptions();

            if (c.getLightMode())
            {
                BackgroundColor = Color.White;
            }
            else
            {
                BackgroundColor = Color.FromHex("282828");
            }
        }
示例#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);
        }