Example #1
0
        // Do not add any additional code to this method
        private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
        {
            // Set the root visual to allow the application to render
            if (RootVisual != RootFrame)
                RootVisual = RootFrame;

            Rtm.Dispatcher = App.Current.RootVisual.Dispatcher;
            SmartDispatcher.Initialize();

            // Remove this handler since it is no longer needed
            RootFrame.Navigated -= CompleteInitializePhoneApplication;

            // track launch
            var analyticsHelper = new AnalyticsHelper();
            var value = (byte[])DeviceExtendedProperties.GetValue("DeviceUniqueId");
            var id = Convert.ToBase64String(value);
            analyticsHelper.Track("Launch", id);
        }
Example #2
0
        public static void OnCacheTasks(Response response)
        {
            TasksResponse = response;

            // track caching
            var an = new Helper.AnalyticsHelper();
            var value = (byte[])DeviceExtendedProperties.GetValue("DeviceUniqueId");
            var id = Convert.ToBase64String(value);
            an.Track("CacheTasks", id);
        }
Example #3
0
        // Code to execute on Unhandled Exceptions
        private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            if (e.ExceptionObject is RtmException)
            {
                var ex = (e.ExceptionObject as RtmException).ResponseError;
                RootFrame.Dispatcher.BeginInvoke(() =>
                {
                    MessageBox.Show(ex.Message, "Error " + ex.Code, MessageBoxButton.OK);
                });
            }
            else if (e.ExceptionObject is WebException)
            {
                WebException ex = e.ExceptionObject as WebException;

                RootFrame.Dispatcher.BeginInvoke(() =>
                {
                    MessageBox.Show(ex.Message + "\nAre you connected to the Internet?", "Error contacting server", MessageBoxButton.OK);
                });
            }
            else
            {
                RootFrame.Dispatcher.BeginInvoke(() =>
                {
                    Exception ex = e.ExceptionObject;

                    MessageBox.Show(ex.Message, ex.GetType().ToString(), MessageBoxButton.OK);
                });
            }

            // track unhandled exception
            Exception exc = e.ExceptionObject;
            var an = new Helper.AnalyticsHelper();
            var value = (byte[])DeviceExtendedProperties.GetValue("DeviceUniqueId");
            var id = Convert.ToBase64String(value);
            an.Track(exc.GetType().ToString(), exc.Message);

            e.Handled = true;

            if (System.Diagnostics.Debugger.IsAttached)
            {
                // An unhandled exception has occurred; break into the debugger
                System.Diagnostics.Debugger.Break();
            }
        }
Example #4
0
        public static void OnCacheTasks(Response response)
        {
            TasksResponse = response;

            // track caching
            var an = new Helper.AnalyticsHelper();
            var value = (byte[])DeviceExtendedProperties.GetValue("DeviceUniqueId");
            var id = Convert.ToBase64String(value);
            an.Track("CacheTasks", id);

            PushNotificationHelper p = new PushNotificationHelper(RtmClient.TaskLists["Inbox"]);
        }