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"); } }
public EditAlert() { Content = BuildContent(); alertTypes = c.getAlertTypeDescriptions(); if (c.getLightMode()) { BackgroundColor = Color.White; } else { BackgroundColor = Color.FromHex("282828"); } }
public static string getAlertTypeNameFromID(int alertTypeID) { alertTypeID++; //Add one to match server ControlVars c = new ControlVars(); List <string> alertTypes = c.getAlertTypeDescriptions(); return(alertTypes[alertTypeID]); }
public DrivingMode() { NavigationPage.SetHasNavigationBar(this, false); Content = BuildContent(); alertTypes = c.getAlertTypeDescriptions(); if (c.getLightMode()) { BackgroundColor = Color.White; } else { BackgroundColor = Color.FromHex("282828"); } }
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); }