// 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) { var nameHelper = new AssemblyName(Assembly.GetExecutingAssembly().FullName); var version = nameHelper.Version; var full = nameHelper.FullName; var name = nameHelper.Name; ApplicationUsageHelper.Init(version.ToString()); RadRateApplicationReminder radRateApplicationReminder = new RadRateApplicationReminder(); radRateApplicationReminder.AllowUsersToSkipFurtherReminders = true; //radRateApplicationReminder.AreFurtherRemindersSkipped = false; radRateApplicationReminder.RecurrencePerUsageCount = 5; radRateApplicationReminder.Notify(); RadTrialApplicationReminder applicationReminder = new RadTrialApplicationReminder(); //applicationReminder.SimulateTrialForTests = true; //applicationReminder.OccurrencePeriod = new TimeSpan(15, 0, 0, 0); //applicationReminder.AllowedTrialPeriod = new TimeSpan(30, 0, 0, 0); //applicationReminder.OccurrencePeriod = new TimeSpan(0, 0, 5, 0); //applicationReminder.AllowedTrialPeriod = new TimeSpan(0, 0, 15, 0); applicationReminder.AllowedTrialUsageCount = 30; applicationReminder.FreeUsageCount = 15; //applicationReminder.OccurrenceUsageCount = 1; applicationReminder.Notify(); }
/// <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; }
/// <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; }
void MainPage_Loaded(object sender, RoutedEventArgs e) { var rateReminder = new RadRateApplicationReminder { RecurrencePerTimePeriod = TimeSpan.FromDays(3), AllowUsersToSkipFurtherReminders = true }; rateReminder.Notify(); }
private void InitRateReminder() { var rateReminder = new RadRateApplicationReminder() { RecurrencePerUsageCount = 10, AllowUsersToSkipFurtherReminders = true, MessageBoxInfo = GetRateReminderMessage() }; rateReminder.Notify(); }
/// <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; }
public void RemindToRateApp() { var rateReminder = new RadRateApplicationReminder { RecurrencePerUsageCount = _applicationConfiguration.ReminderRecurrencePerUsageCount, MessageBoxInfo = { Content = AppResources.PleaseRateApplicationMessage, Title = AppResources.PleaseRateApplicationMessageTitle, SkipFurtherRemindersMessage = AppResources.PleaseRateApplicationDoNotShowAgainText }, AllowUsersToSkipFurtherReminders = true }; rateReminder.Notify(); }
/// <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 = 2; }
private void RateMeButton_Click(object sender, System.Windows.RoutedEventArgs e) { RateButtonClick.Fire(this); DataTemplate template = this.Resources["RateAppTemplate"] as DataTemplate; RadRateApplicationReminder reminder = new RadRateApplicationReminder(); reminder.MessageBoxInfo = new MessageBoxInfoModel() { Buttons = MessageBoxButtons.YesNo, Title = string.Empty, Content = new ContentControl() { ContentTemplate = template } }; reminder.AllowUsersToSkipFurtherReminders = false; reminder.RecurrencePerUsageCount = 1; reminder.Notify(); }
/// <summary> /// Check to see whehter the user needs to rate the application /// </summary> public void CheckWhetherUserWantsToRateApplication() { var radRateApplicationReminder = new RadRateApplicationReminder { RecurrencePerUsageCount = 50, AllowUsersToSkipFurtherReminders = true, MessageBoxInfo = new MessageBoxInfoModel() { Buttons = MessageBoxButtons.YesNo, Content = "Would you like to rate our app in the marketplace?", SkipFurtherRemindersMessage = "Skip further reminders", Title = string.Format("Rate {0}", this.applicationName) } }; radRateApplicationReminder.Notify(); }
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; }
/// <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>(); }
// 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); }
/// <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(); } }
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() { // Standard XAML initialization InitializeComponent(); // 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; } BlobCache.ApplicationName = "ThePaperWall"; BlobCache.LocalMachine.InsertObject("Why", "why why"); this.reminder = new RadRateApplicationReminder(); reminder.RecurrencePerUsageCount = 3; reminder.AllowUsersToSkipFurtherReminders = true; PhoneApplicationService.Current.Closing += App_Exit; this.UnhandledException += App_UnhandledException; this.Exit += App_Exit; }
/// <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(); }
/// <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; }
// Load data for the ViewModel Items private void MainPage_Loaded(object sender, RoutedEventArgs e) { if (!App.ViewModel.IsDataLoaded) { App.ViewModel.LoadData(); } FlurryWP7SDK.Api.StartSession("V79HY87VJY8HH6TY4WK9"); RadRateApplicationReminder reminder = new RadRateApplicationReminder(); reminder.AllowUsersToSkipFurtherReminders= true; reminder.RecurrencePerUsageCount = 2; reminder.Notify(); }
/// <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(); }
private void showRate() { RadRateApplicationReminder ratemyapp = new RadRateApplicationReminder(); ratemyapp.MessageBoxInfo.Content = "Thank you for using my application! Please rate this app so that I can make more applications and improve this one, Thank you!"; ratemyapp.MessageBoxInfo.Title = "Give us a 5 star rating!"; ratemyapp.AllowUsersToSkipFurtherReminders = true ; ratemyapp.RecurrencePerUsageCount = 4; ratemyapp.Notify(); }
/// <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(); }
/// <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>(); }
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; }