Ejemplo n.º 1
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            RadDiagnostics radDiagnostics = new RadDiagnostics();
            radDiagnostics.EmailTo = "*****@*****.**";
            radDiagnostics.ApplicationName = "PunchClock WP7";
            radDiagnostics.ApplicationVersion = "1.0";
            radDiagnostics.ExceptionOccurred += new EventHandler<ExceptionOccurredEventArgs>(RadDiagnostics_ExceptionOccurred);
            radDiagnostics.IncludeScreenshot = true;
            radDiagnostics.Init();

            // Add an Application Bar
            ApplicationBar = new ApplicationBar();
            ApplicationBar.IsMenuEnabled = true;
            ApplicationBar.IsVisible = true;
            ApplicationBar.Opacity = 1.0;

            ApplicationBarIconButton settingButton = new ApplicationBarIconButton(new Uri("/Images/appbar.feature.settings.rest.png", UriKind.Relative));
            settingButton.Text = "settings";
            settingButton.Click += new EventHandler(settingButton_Click);

            ApplicationBarIconButton helpButton = new ApplicationBarIconButton(new Uri("/Images/appbar.questionmark.rest.png", UriKind.Relative));
            helpButton.Text = "help";
            helpButton.Click += new EventHandler(helpButton_Click);

            ApplicationBar.Buttons.Add(settingButton);
            ApplicationBar.Buttons.Add(helpButton);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            //Creates an instance of the Diagnostics component.
            diagnostics = new RadDiagnostics();

            var assembly = Assembly.GetExecutingAssembly().FullName;
            string version = assembly.Split('=')[1].Split(',')[0];

            //Defines the default email where the diagnostics info will be send.
            diagnostics.EmailTo = "*****@*****.**";

            diagnostics.EmailSubject = "Support Request from Crack The Light Saber " + version;

            //Initializes this instance.
            diagnostics.Init();

              //Creates a new instance of the RadRateApplicationReminder component.
            rateReminder = new RadRateApplicationReminder();

            rateReminder.MessageBoxInfo = new MessageBoxInfoModel()
            {
                Buttons = MessageBoxButtons.YesNo,
                Content = "Would you like to rate our app in the marketplace ?",
                SkipFurtherRemindersMessage = "Skip further reminders",
                Title = "Rate My App"
            };

            //Sets how often the rate reminder is displayed.
            rateReminder.RecurrencePerUsageCount = 10;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            //Creates an instance of the Diagnostics component.
            diagnostics = new RadDiagnostics();

            var    assembly = Assembly.GetExecutingAssembly().FullName;
            string version  = assembly.Split('=')[1].Split(',')[0];

            //Defines the default email where the diagnostics info will be send.
            diagnostics.EmailTo = "*****@*****.**";

            diagnostics.EmailSubject = "Support Request from Crack The Light Saber " + version;

            //Initializes this instance.
            diagnostics.Init();

            //Creates a new instance of the RadRateApplicationReminder component.
            rateReminder = new RadRateApplicationReminder();

            rateReminder.MessageBoxInfo = new MessageBoxInfoModel()
            {
                Buttons = MessageBoxButtons.YesNo,
                Content = "Would you like to rate our app in the marketplace ?",
                SkipFurtherRemindersMessage = "Skip further reminders",
                Title = "Rate My App"
            };

            //Sets how often the rate reminder is displayed.
            rateReminder.RecurrencePerUsageCount = 10;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard XAML initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Language display initialization
            InitializeLanguage();

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Prevent the screen from turning off while under the debugger by disabling
                // the application's idle detection.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }



            //Creates an instance of the Diagnostics component.
            diagnostics = new RadDiagnostics();

            //Defines the default email where the diagnostics info will be send.
            diagnostics.EmailTo = "*****@*****.**";

            //Initializes this instance.
            diagnostics.Init();

            //Creates a new instance of the RadRateApplicationReminder component.
            rateReminder = new RadRateApplicationReminder();

            //Sets how often the rate reminder is displayed.
            rateReminder.RecurrencePerUsageCount = 20;
            ThemeManager.ToLightTheme();
            ThemeManager.SetAccentColor(new Color {
                A = 255, B = 219, G = 110, R = 0
            });

            Domain.AppBase.Current.HiResApp       = false;
            Domain.AppBase.Current.ExtendeInfoApp = false;
        }
Ejemplo n.º 5
0
        private void InitErrorHandler()
        {
            ApplicationUsageHelper.Init(Assembly.GetExecutingAssembly().GetVersion());
            var diagnostics = new RadDiagnostics();

            diagnostics.ExceptionOccurred       += OnExceptionOccurred;
            diagnostics.HandleUnhandledException = true;
            diagnostics.Init();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard XAML initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Language display initialization
            InitializeLanguage();

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Prevent the screen from turning off while under the debugger by disabling
                // the application's idle detection.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            // Create Telerik Diagnostics with support e-mail address
            var diagnostics = new RadDiagnostics
            {
                EmailTo = AppResources.DiagnosticsEmailAddress
            };

            diagnostics.Init();

            // Subscribe to the NetworkAvailabilityChanged event
            DeviceNetworkInformation.NetworkAvailabilityChanged += new EventHandler <NetworkNotificationEventArgs>(NetworkAvailabilityChanged);

            // APP THEME OVERRIDES
            Resources.Remove("PhoneAccentColor");
            Resources.Add("PhoneAccentColor", (Color)Current.Resources["MegaRedColor"]);
            ((SolidColorBrush)Resources["PhoneAccentBrush"]).Color            = (Color)Current.Resources["MegaRedColor"];
            ((SolidColorBrush)Resources["PhoneTextBoxEditBorderBrush"]).Color = (Color)Current.Resources["MegaRedColor"];

#if DEBUG
            // Setup Mocking IAP library (only in debug mode)
            LicenseService.SetupMockIap();
#endif
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard XAML initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Language display initialization
            InitializeLanguage();

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Prevent the screen from turning off while under the debugger by disabling
                // the application's idle detection.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }



            //Creates an instance of the Diagnostics component.
            diagnostics = new RadDiagnostics();

            //Defines the default email where the diagnostics info will be send.
            diagnostics.EmailTo = "*****@*****.**";

            //Initializes this instance.
            diagnostics.Init();

            //Creates a new instance of the RadRateApplicationReminder component.
            rateReminder = new RadRateApplicationReminder();

            //Sets how often the rate reminder is displayed.
            rateReminder.RecurrencePerUsageCount = 20;
            ThemeManager.ToLightTheme();
            ThemeManager.SetAccentColor(new Color { A = 255, B = 219, G = 110, R = 0 });

            Domain.AppBase.Current.HiResApp = false;
            Domain.AppBase.Current.ExtendeInfoApp = false;
        }
Ejemplo n.º 8
0
        protected override void Init()
        {
            Container.Register <ILogger, DebugLogger>();
            Container.Register <DbService, DbService>();
            Container.RegisterInstance <IAsanaResponseProcessor, AsanaResponseProcessor>();
            SmallProfiler.Start();

            Container.Resolve <DbService>().Initialize();

            InteractionEffectManager.AllowedTypes.Add(typeof(RadDataBoundListBoxItem));


            Counter.Start(10669);

            RadDiagnostics diagnostics = new RadDiagnostics();

            diagnostics.EmailTo            = AsanaConstants.FeedbackEmail;
            diagnostics.EmailSubject       = AsanaConstants.AppTitle;
            diagnostics.ApplicationVersion = DeviceHelper.GetAppVersion().ToString();
            //diagnostics.MessageBoxInfo.Title = "";
            diagnostics.MessageBoxInfo.Content = "Would you to like to send information about error to developers?";

            diagnostics.Init();
            Telerik.Windows.Controls.ApplicationUsageHelper.Init(DeviceHelper.GetAppVersion().ToString());
            /// ///

            AsanaStateService.Initialize();


            //ApplicationRatingNotificationServiceFromNokia.Initialize("Winsana","*****@*****.**");


            ViewModelMap.Register <MainPage, MainViewModel>();
            ViewModelMap.Register <WorkspaceDetails, WorkspaceDetailsViewModel>();
            ViewModelMap.Register <UserDetails, UserDetailsViewModel>();
            ViewModelMap.Register <AddEditProject, AddEditProjectViewModel>();
            ViewModelMap.Register <TagDetails, TagDetailsViewModel>();
            ViewModelMap.Register <TaskDetails, TaskDetailsViewModel>();
            ViewModelMap.Register <AddEditTask, AddEditTaskViewModel>();
            ViewModelMap.Register <ProjectDetails, ProjectDetailsViewModel>();
            ViewModelMap.Register <AllTasks, AllTasksViewModel>();
            ViewModelMap.Register <SettingsPage, SettingsViewModel>();

            ViewModelCache.Register <WorkspaceDetailsViewModel>();
            ViewModelCache.Register <ProjectDetailsViewModel>();
            ViewModelCache.Register <UserDetailsViewModel>();
            ViewModelCache.Register <TagDetailsViewModel>();
            ViewModelCache.Register <TaskDetailsViewModel>();



            System.Threading.Tasks.TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Ensure the current culture passed into bindings
            // is the OS culture. By default, WPF uses en-US
            // as the culture, regardless of the system settings.
            LocalizationManager.GlobalStringLoader = new TelerikStringLoader();
            Thread.CurrentThread.CurrentCulture    = CultureInfo.CurrentUICulture;
            Thread.CurrentThread.CurrentUICulture  = CultureInfo.CurrentUICulture;

            var radDiagnostics = new RadDiagnostics();

            radDiagnostics.EmailTo           = "*****@*****.**";
            radDiagnostics.IncludeScreenshot = true;
            radDiagnostics.Init();
            (App.Current.Resources["PhoneAccentBrush"] as SolidColorBrush).Color = Color.FromArgb(0xFF, 0xD2, 0xDA, 0x86);
            _settingsProvider = new SettingsProvider();
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Current.Host.Settings.EnableFrameRateCounter = false;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
            TimeDataInterface.CheckDatabase();
            ReturnVisitsInterface.CheckDatabase();
            RvPreviousVisitsDataInterface.CheckDatabase();
            RBCTimeDataInterface.CheckDatabase();
            TerritoryCardsInterface.CheckDatabase();
            StreetBuildingInterface.CheckDatabase();
            House2HouseRecordsInterface.CheckDatabase();
        }
Ejemplo n.º 10
0
		/// <summary>
		/// Constructor for the Application object.
		/// </summary>
		public App()
		{
            // Ensure the current culture passed into bindings 
            // is the OS culture. By default, WPF uses en-US 
            // as the culture, regardless of the system settings.
            LocalizationManager.GlobalStringLoader = new TelerikStringLoader();
		    Thread.CurrentThread.CurrentCulture = CultureInfo.CurrentUICulture;
		    Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture;

			var radDiagnostics = new RadDiagnostics();
			radDiagnostics.EmailTo = "*****@*****.**";
			radDiagnostics.IncludeScreenshot = true;
			radDiagnostics.Init();
			(App.Current.Resources["PhoneAccentBrush"] as SolidColorBrush).Color = Color.FromArgb(0xFF, 0xD2, 0xDA, 0x86);
			_settingsProvider = new SettingsProvider();
			// Global handler for uncaught exceptions. 
			UnhandledException += Application_UnhandledException;

			// Standard Silverlight initialization
			InitializeComponent();

			// Phone-specific initialization
			InitializePhoneApplication();

			// Show graphics profiling information while debugging.
			if (Debugger.IsAttached) {
				// Display the current frame rate counters.
				Current.Host.Settings.EnableFrameRateCounter = false;

				// Show the areas of the app that are being redrawn in each frame.
				//Application.Current.Host.Settings.EnableRedrawRegions = true;

				// Enable non-production analysis visualization mode, 
				// which shows areas of a page that are handed off to GPU with a colored overlay.
				//Application.Current.Host.Settings.EnableCacheVisualization = true;

				// Disable the application idle detection by setting the UserIdleDetectionMode property of the
				// application's PhoneApplicationService object to Disabled.
				// Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
				// and consume battery power when the user is not using the phone.
				PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
			}
			TimeDataInterface.CheckDatabase();
			ReturnVisitsInterface.CheckDatabase();
			RvPreviousVisitsDataInterface.CheckDatabase();
			RBCTimeDataInterface.CheckDatabase();
		    TerritoryCardsInterface.CheckDatabase();
            StreetBuildingInterface.CheckDatabase();
            House2HouseRecordsInterface.CheckDatabase();
		}
Ejemplo n.º 11
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            //Detection Mode
            PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
            PhoneApplicationService.Current.UserIdleDetectionMode        = IdleDetectionMode.Disabled;

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            //Creates an instance of the Diagnostics component.
            diagnostics = new RadDiagnostics();

            //Defines the default email where the diagnostics info will be send.
            diagnostics.EmailTo = "*****@*****.**";

            //Initializes this instance.
            diagnostics.Init();

            //Creates a new instance of the RadRateApplicationReminder component.
            rateReminder = new RadRateApplicationReminder();

            //Sets how often the rate reminder is displayed.
            rateReminder.RecurrencePerUsageCount = 10;
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            ApplicationUsageHelper.Init("1.8.2.1");

            //Global exception handling
            var diagnostics = new RadDiagnostics {
                EmailTo = "*****@*****.**"
            };

            diagnostics.Init();


            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            var color = System.Windows.Media.Color.FromArgb(255, 31, 117, 204);

            ThemeManager.SetAccentColor(color);
            ThemeManager.OverrideOptions = ThemeManagerOverrideOptions.None;

            ThemeManager.ToLightTheme();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                //TODO: Uncomment the code
                //Display the current frame rate counters.
                const bool helper = false;
                Current.Host.Settings.EnableFrameRateCounter = helper;
                MetroGridHelper.IsVisible = helper;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
            LocalizationManager.GlobalResourceManager = WP_to_WP.International.Translations.ResourceManager;
            //Creates an instance of the Diagnostics component.
            diagnostics = new RadDiagnostics();

            //Defines the default email where the diagnostics info will be send.
            diagnostics.EmailTo = "*****@*****.**";

            //Initializes this instance.
            diagnostics.Init();

              //Creates a new instance of the RadRateApplicationReminder component.
            rateReminder = new RadRateApplicationReminder();

            //Sets how often the rate reminder is displayed.
            rateReminder.RecurrencePerUsageCount = 20;

            ThemeManager.ToDarkTheme();
        }
Ejemplo n.º 14
0
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard XAML initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Language display initialization
            InitializeLanguage();

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Prevent the screen from turning off while under the debugger by disabling
                // the application's idle detection.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            diagnostics = new RadDiagnostics();

            diagnostics.EmailTo = "*****@*****.**";

            diagnostics.Init();

            rateReminder = new RadRateApplicationReminder();
            rateReminder.RecurrencePerUsageCount = 5;
            rateReminder.AllowUsersToSkipFurtherReminders = true;
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            ApplicationUsageHelper.Init("1.8.2.1");

            //Global exception handling
            var diagnostics = new RadDiagnostics { EmailTo = "*****@*****.**" };
            diagnostics.Init();

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            var color = System.Windows.Media.Color.FromArgb(255, 31, 117, 204);

            ThemeManager.SetAccentColor(color);
            ThemeManager.OverrideOptions = ThemeManagerOverrideOptions.None;

            ThemeManager.ToLightTheme();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                //TODO: Uncomment the code
                //Display the current frame rate counters.
                const bool helper = false;
                Current.Host.Settings.EnableFrameRateCounter = helper;
                MetroGridHelper.IsVisible = helper;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
        }
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            diagnostics = new RadDiagnostics {EmailTo = "*****@*****.**"};
            diagnostics.Init();

            rateReminder = new RadRateApplicationReminder {RecurrencePerUsageCount = 3};

            CurrentCulture = Thread.CurrentThread.CurrentCulture.ToString();
            CurrentUICulture = Thread.CurrentThread.CurrentUICulture.ToString();

            AdManager = AdManager.Instance;
            LocalizedResources.LoadLocalizedResource();
            ImageTools.IO.Decoders.AddDecoder<GifDecoder>();
        }
Ejemplo n.º 17
0
        public App()
        {
            UnhandledException += Application_UnhandledException;

            InitializeComponent();

            InitializePhoneApplication();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            //Creates an instance of the Diagnostics component.
            diagnostics = new RadDiagnostics();

            //Defines the default email where the diagnostics info will be send.
            diagnostics.EmailTo = "*****@*****.**";

            //Initializes this instance.
            diagnostics.Init();

              //Creates a new instance of the RadRateApplicationReminder component.
            rateReminder = new RadRateApplicationReminder();

            //Sets how often the rate reminder is displayed.
            rateReminder.RecurrencePerUsageCount = 5;
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
            //                Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;

                RadRateApplicationReminder radRateApplicationReminder = new RadRateApplicationReminder();
                radRateApplicationReminder.RecurrencePerUsageCount = 5;

                var radDiagnostics = new RadDiagnostics();
                radDiagnostics.EmailTo = "*****@*****.**";
                radDiagnostics.IncludeScreenshot = true;
                radDiagnostics.ExceptionOccurred += new EventHandler<ExceptionOccurredEventArgs>(RadDiagnostics_ExceptionOccurred);
                radDiagnostics.Init();
            }
        }
Ejemplo n.º 19
0
        // Code to execute when the application is launching (eg, from Start)
        // This code will not execute when the application is reactivated
        private void Application_Launching(object sender, LaunchingEventArgs e)
        {
            ApplicationUsageHelper.Init("1.0");
            try
            {
                string val = IsolatedStorageSettings.ApplicationSettings["RemindAgain"].ToString();
            }
            catch (KeyNotFoundException)
            {
                RadRateApplicationReminder reminder = new RadRateApplicationReminder();
                reminder.AllowUsersToSkipFurtherReminders = true;
                reminder.MessageBoxInfo = new Telerik.Windows.Controls.Reminders.MessageBoxInfoModel()
                {
                    Title   = "Rate Liquid Gold",
                    Buttons = MessageBoxButtons.YesNo,
                    Content = "Would you like to rate this app? It would be greatly appreciated.",
                    SkipFurtherRemindersMessage = "Skip further reminders"
                };
                reminder.ShowReminderMessage(reminder.MessageBoxInfo);
                reminder.ReminderClosed += new EventHandler <ReminderClosedEventArgs>(reminder_ReminderClosed);
            }

            Diagnostics = new RadDiagnostics()
            {
                EmailTo                  = "*****@*****.**",
                EmailSubject             = "ERROR",
                IncludeScreenshot        = true,
                HandleUnhandledException = true,
                ApplicationName          = "Liquid Gold",
                ApplicationVersion       = "1.0"
            };
            Diagnostics.MessageBoxInfo = new Telerik.Windows.Controls.Reminders.MessageBoxInfoModel()
            {
                Buttons = MessageBoxButtons.YesNo,
                Title   = "ERROR",
                Content = "There seems to have been an error. Do you want to send a report to help resolve this issue?"
            };
            Diagnostics.Init();
            Diagnostics.ExceptionOccurred += new EventHandler <ExceptionOccurredEventArgs>(Diagnostics_ExceptionOccurred);
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            licenseInfo = new LicenseInformation();

            detectCurrentTheme();

            // Initialize diagnostics
            radDiagnostics         = new RadDiagnostics();
            radDiagnostics.EmailTo = "*****@*****.**";
            radDiagnostics.Init();
        }
Ejemplo n.º 21
0
        public App()
        {
            UnhandledException += Application_UnhandledException;

            InitializeComponent();

            InitializePhoneApplication();

            if (System.Diagnostics.Debugger.IsAttached)
            {
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            diagnostics = new RadDiagnostics();
            diagnostics.EmailTo = "*****@*****.**";
            diagnostics.Init();

            rateReminder = new RadRateApplicationReminder();
            rateReminder.RecurrencePerUsageCount = 5;
            rateReminder.AllowUsersToSkipFurtherReminders = false;
        }
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached) {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            //Creates an instance of the Diagnostics component.
            diagnostics = new RadDiagnostics();

            //Defines the default email where the diagnostics info will be send.
            diagnostics.EmailTo = "*****@*****.**";

            //Initializes this instance.
            diagnostics.Init();

            //Creates a new instance of the RadRateApplicationReminder component.
            rateReminder = new RadRateApplicationReminder();

            //Sets how often the rate reminder is displayed.
            rateReminder.RecurrencePerUsageCount = 3;

            PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;

            RootFrame.Obscured += Application_Obscured;
            RootFrame.Unobscured += Application_UnObscured;

            CurrentCulture = Thread.CurrentThread.CurrentCulture.ToString();
            CurrentUICulture = Thread.CurrentThread.CurrentUICulture.ToString();
            DataTracker = new Tracker();
            DataTracker.RegisterNewDeviceIfNotAlready();

            DownloadCloudAppConfig();
            //LoadDefaultCloudAppConfig();
            LoadLocalizedResource();
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Language display initialization
            InitializeLanguage();

            TelemetryClient = new TelemetryClient();

            KernelService.Kernel = new StandardKernel();
            KernelService.Kernel.Bind <TelemetryClient>().ToConstant <TelemetryClient>(TelemetryClient);
            KernelService.Kernel.Bind <INavigationService>().To <PhoneNavigationService>().InSingletonScope();
            KernelService.Kernel.Bind <ISettingsService>().To <PhoneSettingsService>().InSingletonScope();
            KernelService.Kernel.Bind <IWebNavigationService>().To <PhoneWebNavigationService>().InSingletonScope();
            KernelService.Kernel.Bind <IEntry>().To <PhoneEntry>();
            KernelService.Kernel.Bind <IRepository <IEntry> >().To <WP8EntryRepository>().InSingletonScope();
            KernelService.Kernel.Bind <AboutViewModel>().To <PhoneAboutViewModel>();
            KernelService.Kernel.Bind <MainViewModel>().ToSelf().InSingletonScope();
            KernelService.Kernel.Bind <IMobileServiceClient>().ToMethod <MobileServiceClient>(it =>
            {
                var client = new MobileServiceClient(
                    "https://whatieat.azure-mobile.net/",
                    "stXIOZDpAbYsxvASsmSXyRVTgXsYXU62"
                    );
                client.SerializerSettings.DateParseHandling    = Newtonsoft.Json.DateParseHandling.DateTimeOffset;
                client.SerializerSettings.DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.RoundtripKind;
                client.SerializerSettings.Converters.Remove(client.SerializerSettings.Converters.Where(its => its is Microsoft.WindowsAzure.MobileServices.MobileServiceIsoDateTimeConverter).FirstOrDefault());
                return(client);
            });
            KernelService.Kernel.Bind <SyncService>().To <WP8SyncService>().InSingletonScope();
            KernelService.Kernel.Bind <ILoggingService>().To <PhoneLoggingService>().InSingletonScope();
            KernelService.Kernel.Bind <ISkyDriveService>().To <WP8SkyDriveService>();
            KernelService.Kernel.Bind <IIAPService>().To <WP8IAPService>();


            if (!WP8EntryRepository.DbExists() && PhoneEntryRepository.DbExists())
            {
                var log = KernelService.Kernel.Get <ILoggingService>();
                try
                {
                    log.LogMessage("Beginning Telerik Data Migration");
                    using (WP8EntryRepository newRepo = new WP8EntryRepository())
                    {
                        using (PhoneEntryRepository oldRepo = new PhoneEntryRepository())
                        {
                            foreach (var entry in oldRepo.GetAllEntries(true))
                            {
                                newRepo.AddOrUpdateEntry(entry);
                            }
                        }
                    }
                    log.LogMessage("Telerik Data Migration Complete");
                }
                catch (Exception ex)
                {
                    log.LogException(ex, "Telerik Data Migration FAILED");
                }
            }

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                //Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            //Creates an instance of the Diagnostics component.
            diagnostics = new RadDiagnostics();

            //Defines the default email where the diagnostics info will be send.
            diagnostics.EmailTo = "*****@*****.**";
            diagnostics.MessageBoxInfo.Title   = Shane.Church.WhatIEat.Strings.Resources.Diagnostics_MessageBox_Title;
            diagnostics.MessageBoxInfo.Content = Shane.Church.WhatIEat.Strings.Resources.Diagnostics_MessageBox_Content;
            diagnostics.IncludeScreenshot      = true;
            diagnostics.ExceptionOccurred     += diagnostics_ExceptionOccurred;

            //Initializes this instance.
            diagnostics.Init();

            //Creates a new instance of the RadRateApplicationReminder component.
            rateReminder = new RadRateApplicationReminder();

            //Sets how often the rate reminder is displayed.
            rateReminder.RecurrencePerUsageCount          = 5;
            rateReminder.AllowUsersToSkipFurtherReminders = true;

            rateReminder.ReminderClosed += rateReminder_ReminderClosed;
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            licenseInfo = new LicenseInformation();

            detectCurrentTheme();

            // Initialize diagnostics
            radDiagnostics = new RadDiagnostics();
            radDiagnostics.EmailTo = "*****@*****.**";
            radDiagnostics.Init();
        }
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            //Retrieves locale of the mobile device
            CurrentCulture = Thread.CurrentThread.CurrentCulture.ToString();
            CurrentUICulture = Thread.CurrentThread.CurrentUICulture.ToString();

            var uris = new[]
            {
                GetThemeSettingsUri()
            };

            LoadResources(uris);

            //Creates an instance of the Diagnostics component.
            diagnostics = new RadDiagnostics();

            //Defines the default email where the diagnostics info will be send.
            diagnostics.EmailTo = "*****@*****.**";

            //Initializes this instance.
            diagnostics.Init();

              //Creates a new instance of the RadRateApplicationReminder component.
            rateReminder = new RadRateApplicationReminder();

            //Sets how often the rate reminder is displayed.
            rateReminder.RecurrencePerUsageCount = 2;

            IsTrackImageLoad = false;
            AppVersion = "";

            DataTracker = new Tracker();
            DataTracker.RegisterNewDeviceIfNotAlready();

            DownloadCloudAppConfig();
            //LoadDefaultCloudAppConfig();

            _analytics = Analytics.GetInstance();
            //_timeLaunch = DateTime.Now;

            //Initialize user config
            var u = MiscHelpers.GetItemFromIsolatedStorage<UserConfigModel>("fbd-userconfig.xml");
            if (u == null)
            {
                u = new UserConfigModel
                    {
                        FetchLanguage = FetchLanguages.en,
                        FontSize = FontSizes.medium,
                        //FacebookLogin = FacebookLoginStatus.Logout,
                        FacebppkAccessToken = String.Empty,
                        IsTutorialRead = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
                    };
                MiscHelpers.SaveDataToIsolatedStorage("fbd-userconfig.xml", u, typeof (UserConfigModel));

                //Set default hometiles and fetch the corrsponding context
                HomePagePinTiles.GetInstance().InitTiles();
            }
            DataFetcher dataFetcher2 = DataFetcher.GetInstance();
            dataFetcher2.FetchCategories(null);

            UserConfig.FetchLanguage = u.FetchLanguage;
            UserConfig.FontSize = u.FontSize;
            //UserConfig.FacebookLogin = u.FacebookLogin;
            //UserConfig.FacebppkAccessToken = u.FacebppkAccessToken;
            App.AccessToken = u.FacebppkAccessToken;
            UserConfig.IsTutorialRead = u.IsTutorialRead;
            if (UserConfig.IsTutorialRead == null)
            {
                u.IsTutorialRead = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
                MiscHelpers.SaveDataToIsolatedStorage("fbd-userconfig.xml", u, typeof(UserConfigModel));
            }

            //Initialize categories config
            DataFetcher fetcher = DataFetcher.GetInstance();
            CategoryConfigA.Config = fetcher.GetCategoryConfig(
                new Uri("CategoryConfig_" + CultureSelector.GetCultureLocale(CurrentUICulture) + ".json", UriKind.Relative)
            );
            CategoryConfigB.Config = fetcher.GetCategoryConfig(
                new Uri("CategoryConfig_" + UserConfig.FetchLanguage + ".json", UriKind.Relative)
            );

            BackgroundWorker bw = new BackgroundWorker();
            bw.WorkerSupportsCancellation = true;
            bw.WorkerReportsProgress = true;
            bw.DoWork += delegate
            {
                //Initial file management
                //FileHelper.RemoveAllFeedBoardFiles();
                //Removed all feedboard cache files
                FileHelper.RemoveFeedBoardCaches();
                FileHelper.RemoveRedundantFeedBoardFiles();
                //FileHelper.ViewFiles();

                //Prefetcher
                DataFetcher dataFetcher = DataFetcher.GetInstance();
                dataFetcher.PreFetch();
            };
            bw.RunWorkerAsync();

            //Background agent
            BackgroundAgent b = new BackgroundAgent();
            //b.StartPeriodicAgent();
            b.StartResourceIntensiveAgent();
        }
Ejemplo n.º 26
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            MergeCustomColors();

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Language display initialization
            InitializeLanguage();

            TelemetryClient = new TelemetryClient();

            KernelService.Kernel = new StandardKernel();
            KernelService.Kernel.Bind <TelemetryClient>().ToConstant <TelemetryClient>(TelemetryClient);
            KernelService.Kernel.Bind <INavigationService>().To <PhoneNavigationService>().InSingletonScope();
            KernelService.Kernel.Bind <ISettingsService>().To <PhoneSettingsService>().InSingletonScope();
            KernelService.Kernel.Bind <IWebNavigationService>().To <PhoneWebNavigationService>().InSingletonScope();
            KernelService.Kernel.Bind <IBirthdaySource>().To <PhoneBirthdaySource>().InSingletonScope();
            KernelService.Kernel.Bind <MainViewModel>().To <PhoneMainViewModel>().InSingletonScope();
            KernelService.Kernel.Bind <ContactViewModel>().To <PhoneContactViewModel>();
            KernelService.Kernel.Bind <AboutViewModel>().To <PhoneAboutViewModel>();
            KernelService.Kernel.Bind <SettingsViewModel>().ToSelf();
            KernelService.Kernel.Bind <IAgentManagementService>().To <PhoneAgentManagementService>().InSingletonScope();
            KernelService.Kernel.Bind <ITileUpdateService>().To <PhoneTileUpdateService>().InSingletonScope();
            KernelService.Kernel.Bind <ILoggingService>().To <PhoneLoggingService>().InSingletonScope();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                //Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            //Creates an instance of the Diagnostics component.
            diagnostics = new RadDiagnostics();

            //Defines the default email where the diagnostics info will be send.
            diagnostics.EmailTo = "*****@*****.**";
            diagnostics.MessageBoxInfo.Title   = Shane.Church.StirlingBirthday.Strings.Resources.Diagnostics_MessageBox_Title;
            diagnostics.MessageBoxInfo.Content = Shane.Church.StirlingBirthday.Strings.Resources.Diagnostics_MessageBox_Content;
            diagnostics.IncludeScreenshot      = true;
            diagnostics.ExceptionOccurred     += diagnostics_ExceptionOccurred;

            //Initializes this instance.
            diagnostics.Init();

            //Creates an instance of the RadTrialApplicationReminder component.
            trialReminder = new RadTrialApplicationReminder();
            trialReminder.TrialReminderMessageBoxInfo.Title   = Shane.Church.StirlingBirthday.Strings.Resources.AppTrialReminder_MessageBox_Title;
            trialReminder.TrialReminderMessageBoxInfo.Content = Shane.Church.StirlingBirthday.Strings.Resources.AppTrialReminder_MessageBox_Content;
            trialReminder.TrialReminderMessageBoxInfo.SkipFurtherRemindersMessage = Shane.Church.StirlingBirthday.Strings.Resources.AppTrialReminder_MessageBox_SkipFurtherRemindersMessage;
            trialReminder.TrialExpiredMessageBoxInfo.Title   = Shane.Church.StirlingBirthday.Strings.Resources.AppTrialEnd_MessageBox_Title;
            trialReminder.TrialExpiredMessageBoxInfo.Content = Shane.Church.StirlingBirthday.Strings.Resources.AppTrialEnd_MessageBox_Content;
            trialReminder.TrialExpiredMessageBoxInfo.SkipFurtherRemindersMessage = Shane.Church.StirlingBirthday.Strings.Resources.AppTrialEnd_MessageBox_SkipFurtherRemindersMessage;

            //Sets the length of the trial period.
            trialReminder.AllowedTrialPeriod = TimeSpan.MaxValue;

#if DEBUG_TRIAL
            //The reminder is shown only if the application is in trial mode. When this property is set to true the application will simulate that it is in trial mode.
            trialReminder.SimulateTrialForTests = true;
            trialReminder.OccurrenceUsageCount  = 1;
#else
            trialReminder.FreePeriod = TimeSpan.FromDays(7);

            //Sets how often the trial reminder is displayed.
            trialReminder.OccurrencePeriod = TimeSpan.FromDays(7);
#endif

            trialReminder.AllowUsersToSkipFurtherReminders = true;

            //Creates a new instance of the RadRateApplicationReminder component.
            rateReminder = new RadRateApplicationReminder();
            rateReminder.MessageBoxInfo.Title   = Shane.Church.StirlingBirthday.Strings.Resources.RateReminder_MessageBox_Title;
            rateReminder.MessageBoxInfo.Content = Shane.Church.StirlingBirthday.Strings.Resources.RateReminder_MessageBox_Content;
            rateReminder.MessageBoxInfo.SkipFurtherRemindersMessage = Shane.Church.StirlingBirthday.Strings.Resources.RateReminder_MessageBox_SkipFurtherRemindersMessage;
            rateReminder.MessageBoxInfo.Buttons = MessageBoxButtons.YesNo;

            //Sets how often the rate reminder is displayed.
            rateReminder.RecurrencePerUsageCount          = 5;
            rateReminder.AllowUsersToSkipFurtherReminders = true;

            rateReminder.ReminderClosed += rateReminder_ReminderClosed;

            InitializeBackgroundAgent();
        }
Ejemplo n.º 27
0
        public App()
        {
            // Global handler for uncaught exceptions. 
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                //Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode, 
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                //PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            Model.IsRoaming = false; // not supported for WP
            Model.StorageProvider = new StorageProvider();
            Model.PropertyChanged += Settings_PropertyChanged;

            EcosModel.PropertyChanged += EcosModel_PropertyChanged;
            EcosModel.CommandError += EcosModel_CommandError;
            EcosModel.Log += EcosModel_Log;
            EcosModel.EcosManager.PropertyChanged += EcosManager_PropertyChanged;

            ProfilesManager.Items = new ObservableCollection<Profile>(Model.Profiles);
            ProfilesManager.Items.CollectionChanged += Profiles_CollectionChanged;

            SetLanguage(Model.Language);

            diagnostics = new RadDiagnostics();
            diagnostics.ApplicationName = App.Name;
            diagnostics.ApplicationVersion = App.Version;
            diagnostics.EmailTo = App.Email;
            //diagnostics.EmailSubject = "Unhandled exception";
            //diagnostics.IncludeScreenshot = true;
            diagnostics.Init();

            //trialReminder = new RadTrialApplicationReminder(); //Creates an instance of the RadTrialApplicationReminder component.
            //trialReminder.AllowedTrialUsageCount = 30; //Sets the lenght of the trial period.
            //trialReminder.OccurrenceUsageCount = 2; //Sets how often the trial reminder is displayed.
            //trialReminder.SimulateTrialForTests = true; //The reminder is shown only if the application is in trial mode. When this property is set to true the application will simulate that it is in trial mode.

            rateReminder = new RadRateApplicationReminder();
            //rateReminder.SkipFurtherRemindersOnYesPressed = true;
            rateReminder.RecurrencePerUsageCount = 10;
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            //Creates a new instance of the RadRateApplicationReminder component.
            rateReminder = new RadRateApplicationReminder();

            //Sets how often the rate reminder is displayed.
            rateReminder.RecurrencePerUsageCount = 4;

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            //Creates an instance of the Diagnostics component.
            diagnostics = new RadDiagnostics()
            {
                EmailTo = FeedbackEmail,
                ApplicationName = AppTitle,
                ApplicationVersion = AppVersion,
                IncludeScreenshot = true
            };

            //Initializes this instance.
            diagnostics.Init();

            // Specify the local database connection string.
            string DBConnectionString = "Data Source=isostore:/Mindsweep.sdf";

            // Create the database if it does not exist.
            using (MainDataContext db = new MainDataContext(DBConnectionString))
            {
                if (db.DatabaseExists() == false)
                {
                    // Create the local database.
                    db.CreateDatabase();
                }
            }

            // Create the ViewModel object.
            viewModel = new MainViewModel(DBConnectionString);

            // Query the local database and load observable collections.
            viewModel.LoadCollectionsFromDatabase();
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            ThemeManager.ToLightTheme();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
               // Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            //Creates an instance of the Diagnostics component.
            diagnostics = new RadDiagnostics();

            //Defines the default email where the diagnostics info will be send.
            diagnostics.EmailTo = "*****@*****.**";
            diagnostics.IncludeScreenshot = true;
            diagnostics.ApplicationName = "BettrDiet";
            XDocument doc = XDocument.Load("WMAppManifest.xml");
            var app = doc.Root.Element("App");
            var vers = app.Attribute("Version");
            diagnostics.ApplicationVersion = vers.Value;
            //Initializes this instance.
            diagnostics.Init();
            //Creates an instance of the RadTrialApplicationReminder component.
            trialReminder = new RadTrialApplicationReminder();

            //Sets the lenght of the trial period.
            trialReminder.AllowedTrialUsageCount = 30;

            //Sets how often the trial reminder is displayed.
            trialReminder.OccurrenceUsageCount = 2;

            //The reminder is shown only if the application is in trial mode. When this property is set to true the application will simulate that it is in trial mode.
            trialReminder.SimulateTrialForTests = true;

              //Creates a new instance of the RadRateApplicationReminder component.
            rateReminder = new RadRateApplicationReminder();

            //Sets how often the rate reminder is displayed.
            rateReminder.RecurrencePerUsageCount = 2;

            var setup = new Setup(RootFrame);
            setup.Initialize();

            DeviceNetworkInformation.NetworkAvailabilityChanged += DeviceNetworkInformation_NetworkAvailabilityChanged;

            _messenger = Mvx.Resolve<IMvxMessenger>();
        }