public void HandleApiExceptionForForecastData(ApiException e, MetaDataCityRow city, ParkingLot lot) { _tracking.TrackException(e, new Dictionary<string, string>() { { "handled", "true"}, { "type", "forecast"}, { "city", city?.Id }, { "lot", lot?.Id } }); var mailStr = string.Format(EmailFormat, ContactEmail, Uri.EscapeDataString(string.Format(_res.ExceptionMailForecastSubject, lot?.Name, city?.Name)), Uri.EscapeDataString(string.Format(_res.ExceptionMailForecastBody, lot?.Name, city?.Name, e.Message)) ); var content = new ToastContent { Launch = "handledForecastApiException", Visual = new ToastVisual { TitleText = new ToastText { Text = _res.ExceptionToastTitle }, BodyTextLine1 = new ToastText { Text = string.Format(_res.ExceptionToastForecastContent, lot?.Name, city?.Name) } }, Actions = new ToastActionsCustom { Buttons = { new ToastButton(_res.ExceptionToastShowInBrowserButton, city?.Url.ToString()) { ActivationType = ToastActivationType.Protocol, }, new ToastButton(_res.ExceptionToastContactDevButton, mailStr) { ActivationType = ToastActivationType.Protocol, } } } }; ShowToast(content); }
public void HandleApiExceptionForMetaData(ApiException e) { _tracking.TrackException(e, new Dictionary<string, string>() { { "handled", "true"}, { "type", "metadata"}, }); var mailStr = string.Format(EmailFormat, ContactEmail, Uri.EscapeDataString(_res.ExceptionMailMetaDataSubject), Uri.EscapeDataString(string.Format(_res.ExceptionMailMetaDataBody, e.Message)) ); var content = new ToastContent { Launch = "handledMetaDataApiException", Visual = new ToastVisual { TitleText = new ToastText { Text = _res.ExceptionToastTitle }, BodyTextLine1 = new ToastText { Text = _res.ExceptionToastMetaDataContent } }, Actions = new ToastActionsCustom { Buttons = { new ToastButton(_res.ExceptionToastVisitParkenDdButton, "http://www.parkendd.de") { ActivationType = ToastActivationType.Protocol, }, new ToastButton(_res.ExceptionToastContactDevButton, mailStr) { ActivationType = ToastActivationType.Protocol, } } } }; ShowToast(content); }