Example #1
0
        private void OptionSelected(AlternativeRoutesPageViewModel.OptionSelectedEventArgs.Options selectedOption)
        {
            //Report statistics:
            string optionString = selectedOption.ToString();
            string optionName   = optionString.Substring(optionString.LastIndexOf(".") + 1);

            WebStats.ReportWebStatEventDetailsAsync("AlternativeRoutes", optionName);


            ViewModel.NotifyOptionSelected(selectedOption, (currentItem == null) ? 0 : currentItem.ContextPointer);
            if (selectedOption != AlternativeRoutesPageViewModel.OptionSelectedEventArgs.Options.Cancel)
            {
                NavigateBackHome();
            }
        }
        private void OptionSelected(SingleSearchResultsPivotPageContext.SearchOption searchOption)
        {
            //Report statistics:
            string optionString = searchOption.ToString();
            string optionName   = optionString.Substring(optionString.LastIndexOf(".") + 1);

            WebStats.ReportWebStatEventDetailsAsync("SearchOption", optionName);

            // Call the callback to start the operation
            PageContext.OnSearchOptionSelected(selectedResult.ReferenceIndex, searchOption, InputTextBox.Text);

            // And close the dialog (need to pop the search input page as well)
            NavigationService.RemoveBackEntry();
            NavigationService.GoBack();
        }
Example #3
0
        private void DoCallBack(string callbackName)
        {
            WebStats.ReportWebStatEventDetailsAsync("Report", callbackName);

            foreach (WazeMenuItem menuItem in miniMenuItems)
            {
                if (menuItem.text == callbackName || menuItem.text == LanguageResources.Instance.Translate(callbackName))
                {
                    menuItem.CallCallback();

                    return;
                }
            }

            throw new NotSupportedException(string.Format("Could not find callback {0}. Total callbacks found: {1}", callbackName, miniMenuItems.Count));
        }
Example #4
0
        public void SearchCompleted(SingleSearchResultsPivotPageContext.SearchOptionSelectedDelegate onSearchOptionSelected, string localSearchProviderLabel,
                                    IEnumerable <SingleSearchResultsPivotPageContext.SearchResult> addressResults, IEnumerable <SingleSearchResultsPivotPageContext.SearchResult> localSearchResults)
        {
            var searchResultsPageContext = new SingleSearchResultsPivotPageContext
            {
                OnSearchOptionSelected   = onSearchOptionSelected,
                LocalSearchProviderLabel = localSearchProviderLabel,
                AddressResults           = new ObservableCollection <SingleSearchResultsPivotPageContext.SearchResult>(addressResults),
                LocalSearchResults       = new ObservableCollection <SingleSearchResultsPivotPageContext.SearchResult>(localSearchResults),
            };

            //Report search results stats
            WebStats.ReportWebStatEventDetailsAsync("Search Complete", "Address count: " + addressResults.Count() + " Local count: " + localSearchResults.Count());

            NavigationService.Navigate <SingleSearchResultsPivotPage>(searchResultsPageContext);
        }
Example #5
0
        private void PerformSearch()
        {
            #region Crash Test Easter Egg

            // Easter egg to intentionally crash waze - for testing
            if (SearchTextBox.Text.Contains("Crash Waze"))
            {
                throw new Exception("Waze Crash Test");
            }

            #endregion Crash Test Easter Egg

            WebStats.ReportWebStatEventAsync("Search");

            InProgressGrid.Visibility = System.Windows.Visibility.Visible;
            SelectAction(ActionType.SingleSearch);
        }
Example #6
0
        private void CloseDialog(NavigateResultControlViewModel.DialogClosingEventArgs.ClosingActions action)
        {
            //Report statistics:
            string actionString = action.ToString();
            string actionName   = actionString.Substring(actionString.LastIndexOf(".") + 1);

            WebStats.ReportWebStatEventAsync(actionName);

            lock (viewModel)
            {
                countdownThread = null;
                this.viewModel.NotifyDialogClosed(action);
                System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    Hide();
                });
            }
        }
Example #7
0
        // Code to execute on Unhandled Exceptions
        private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // An unhandled exception has occurred; break into the debugger
                System.Diagnostics.Debugger.Break();
            }

            if (!(e.ExceptionObject is InvalidProgramException))
            {
                // We need to keep the UI Alive for Azure reporting to function (Library limitation)
                e.Handled = true;

                // Report Crash Event to Azure (Anonymous)
                WebStats.ReportWebStatCrash(e.ExceptionObject.GetType().Name, e.ExceptionObject.ToString());

                //Ask the user to report more info via email, so we can contact him if needed.
                MessageBoxResult result = MessageBox.Show("Waze crashed to to an unexpected exception." + Environment.NewLine +
                                                          "Please press OK to send an error report to the developers." + Environment.NewLine +

                                                          // Since we are not terminating any more, let the user know it is best to restart the app.
                                                          "Notice: Waze may not function correctly untill restarted!",

                                                          "Unexpected error", MessageBoxButton.OKCancel);

                if (result == MessageBoxResult.OK)
                {
                    EmailComposeTask emailComposer = new EmailComposeTask();
                    emailComposer.To      = "*****@*****.**";
                    emailComposer.Subject = string.Format("Waze " + GamePage.get().GetAppVersion() + "Lang: " + LanguageResources.Instance.CurrentLanguage + " crashed due to {0} exception", e.ExceptionObject.GetType());
                    emailComposer.Body    = e.ExceptionObject.ToString();
                    emailComposer.Show();
                    //Thread.Sleep(30000);
                }
            }
        }
Example #8
0
 private void LogInButton_Click(object sender, RoutedEventArgs e)
 {
     WebStats.ReportWebStatEventAsync("Login");
     this.pageContext.OnSignin(this.UsernameTexBox.Text, this.PasswordBox.Password);
 }