Exemplo n.º 1
0
        public static bool IsTrialFromLicence()
        {
#if TRIAL_SIMULATION && !RELEASE
            return(trialSimulationValue);
#endif
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();
            return(license.IsTrial());
        }
Exemplo n.º 2
0
        private void DetermineIsTrail()
        {
#if TRIAL
            IsTrial = true;
#else
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();
            IsTrial = license.IsTrial();
#endif
        }
        // Code to execute when the application is activated (brought to foreground)
        // This code will not execute when the application is first launched
        private void Application_Activated(object sender, ActivatedEventArgs e)
        {
#if TRIAL_LICENSE
            IsTrial = true;
#else
            var licenseInfo = new Microsoft.Phone.Marketplace.LicenseInformation();
            IsTrial = licenseInfo.IsTrial();
#endif
        }
Exemplo n.º 4
0
 static TrialHelper()
 {
     #if TRIAL
     // return true if debugging with trial enabled (DebugTrial configuration is active)
     IsTrial = true;
     #else
       var license = new Microsoft.Phone.Marketplace.LicenseInformation();
       IsTrial = license.IsTrial();
     #endif
 }
Exemplo n.º 5
0
        static TrialHelper()
        {
#if TRIAL
            // return true if debugging with trial enabled (DebugTrial configuration is active)
            IsTrial = true;
#else
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();
            IsTrial = license.IsTrial();
#endif
        }
Exemplo n.º 6
0
        /// <summary>
        /// This should only be called when the app is Launching
        /// </summary>
        public void Launching()
        {
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();

            // Only load state if not trial
            if(!license.IsTrial())
                this.LoadState();

            // Uncomment for testing
            // this._state = FeedbackState.FirstReview;
            // this._state = FeedbackState.SecondReview;
        }
Exemplo n.º 7
0
        /// <summary>
        /// This should only be called when the app is Launching
        /// </summary>
        public void Launching()
        {
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();

            // Only load state if not trial
            if (!license.IsTrial())
            {
                this.LoadState();
            }

            // Uncomment for testing
            // this._state = FeedbackState.FirstReview;
            // this._state = FeedbackState.SecondReview;
        }
Exemplo n.º 8
0
        private void DetermineIsTrail()
        {
#if TRIAL
            IsTrial = true;
#else
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();
            IsTrial = license.IsTrial();
#endif
            try
            {
                EmulatorSettings.Current.IsTrial = IsTrial;
            }
            catch (Exception) { }
        }
Exemplo n.º 9
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            int posizione = SaveLoadObj.LoadFromIsoStore(strDataFileEnablePos);

            if (!license.IsTrial())
            {
                posizione++;

                if (posizione == 106)
                {
                    posizione = 1;
                }

                SaveLoadObj.SaveToIsoStore(strDataFileEnablePos, posizione);

                int punti = 1;
                if (nAiuto == soluzione.Text.Length)
                {
                    punti = 0;
                }

                nPunteggio = SaveLoadObj.LoadFromIsoStore("punteggio") - nAiuto + punti;
                SaveLoadObj.SaveToIsoStore("punteggio", nPunteggio);
                punteggio.Text = "Punteggio: " + nPunteggio;

                txtindovina.Text = "";

                nAiuto = 0;

                gioca();
            }
            else
            {
                if (posizione < 10)
                {
                    posizione++;
                    SaveLoadObj.SaveToIsoStore(strDataFileEnablePos, posizione);
                    txtindovina.Text = "";
                    nAiuto           = 0;

                    gioca();
                }
                else
                {
                    detailTask.Show();
                }
            }
        }
Exemplo n.º 10
0
        public void CheckPurchases()
        {
                        #if WINDOWS_PHONE
            try
            {
                //                if (InstalledProductKind == ProductKind.unknown) return;

                        #if !DEBUG
                if (InstalledProductKind == ProductKind.Trial)
                {
                    var licenseInfo = new Microsoft.Phone.Marketplace.LicenseInformation();
                    if (!licenseInfo.IsTrial())
                    {
                        SessionLog.RecordMilestone("Converted from Trial to Paid", SessionId.ToString());
                        InstalledProductKind = ProductKind.Paid;
                        Save();
                    }
                }
                        #endif

                if (InstalledProductKind == ProductKind.Free && AdShows)
                {
                    var productLicenses = CurrentApp.LicenseInformation.ProductLicenses;
                    foreach (var license in productLicenses.Values)
                    {
                        if (license.IsActive && license.ProductId == RemoveAdsProduct)
                        {
                            SessionLog.RecordMilestone("RemoveAdsProduct Purchased", AppStats.Current.SessionId.ToString());
                            InstalledProductKind = ProductKind.Paid;
                            AdShows = false;
                            Save();
                        }

                        if (license.IsActive && license.ProductId.StartsWith(PremiumProduct))
                        {
                            SessionLog.RecordMilestone(license.ProductId + " Purchased", AppStats.Current.SessionId.ToString());
                            InstalledProductKind = ProductKind.Paid;
                            AdShows         = false;
                            MultiMealHidden = false;
                            Save();
                        }
                    }
                }
            }
            catch (Exception ex) { LittleWatson.ReportException(ex); }
                        #endif
        }
Exemplo n.º 11
0
        public static void ReloadTrialInfo()
        {
            if (IsFull)
            {
                if (Config.TrialStart == DateTime.MaxValue)
                {
                    Config.TrialStart = DateTime.Now;
                }

                var license = new Microsoft.Phone.Marketplace.LicenseInformation();
                IsTrial = license.IsTrial();
            }
            else
            {
                IsTrial = false;
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// Called when FeedbackLayout control is instantiated, which is
        /// supposed to happen when application's main page is instantiated.
        /// </summary>
        public void Launching()
        {
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();

            // Only load state if app is not trial, app is not activated after
            // being tombstoned, and state has not been loaded before.
            if (!license.IsTrial() &&
                PhoneApplicationService.Current.StartupMode == StartupMode.Launch &&
                State == FeedbackState.Active)
            {
                LoadState();
            }

            // Uncomment for testing
            // State = FeedbackState.FirstReview;
            // State = FeedbackState.SecondReview;
        }
Exemplo n.º 13
0
        // Code to execute when the application is activated (brought to foreground)
        // This code will not execute when the application is first launched
        private void Application_Activated(object sender, ActivatedEventArgs e)
        {
            if (!e.IsApplicationInstancePreserved)
            {
                FiltersModel = new FiltersModel();

                try
                {
                    PhotoModel     = TombstoningHelper.RestorePhotoModel();
                    ThumbnailModel = TombstoningHelper.RestorePhotoModel();
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine("Unable to restore photo model: " + ex.Message);
                }

                ViewModelData.IsTrial = LisenceInfo.IsTrial();
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// Checks whether or not this app is in trial mode.
        /// </summary>
        /// <returns></returns>
        public static bool IsTrial()
        {
            var isTrial = false;

            try
            {
                // 1. Force trial experience ?
                if (Settings.ForceTrialExperience)
                    return true;

                var license = new Microsoft.Phone.Marketplace.LicenseInformation();
                isTrial = license.IsTrial();
            }
            catch (Exception)
            {
                // If license access fails for any reason...
                // don't like it crash the app.
            }
            return isTrial;
        }
 // Code to execute when the application is activated (brought to foreground)
 // This code will not execute when the application is first launched
 private void Application_Activated(object sender, ActivatedEventArgs e)
 {
     #if TRIAL_LICENSE
     IsTrial = true;
     #else
     var licenseInfo = new Microsoft.Phone.Marketplace.LicenseInformation();
     IsTrial = licenseInfo.IsTrial();
     #endif
 }
Exemplo n.º 16
0
        private void GetInstalledProductKind()
        {
                        #if DEBUG
            InstalledProductKind = ProductKind.Free;            //.Trial;
                        #endif

            if (InstalledProductKind != ProductKind.unknown)
            {
                return;
            }

                        #if SUPPORTTRIAL
            if (LicensedProducts != null && LicensedProducts.Length > 0)             // legacy, free with ads
            {
                InstalledProductKind = ProductKind.Free;
                return;
            }

            try
            {
                var licenseInfo = new Microsoft.Phone.Marketplace.LicenseInformation();
                if (licenseInfo.IsTrial())
                {
                    InstalledProductKind = ProductKind.Trial;
                }
                else
                {
                    // if paid, we need to figure out if it was free (ads supported), or paid for (remove all ads)

                    var listing = await Windows.ApplicationModel.Store.CurrentApp.LoadListingInformationAsync();

                    foreach (var letter in listing.FormattedPrice)
                    {
                        if (letter != '0' && char.IsDigit(letter))
                        {
                            InstalledProductKind = ProductKind.Paid;
                            SessionLog.CurrentScreen.RecordMilestone("Paid w/o trial", listing.FormattedPrice);
                        }
                    }

                    if (InstalledProductKind == ProductKind.unknown)
                    {
                        InstalledProductKind = ProductKind.Free;
                    }
                }
                try
                {
                    Save();
                }
                catch (Exception ex) { LittleWatson.ReportException(ex); }
                CheckPurchases();
            }
            catch (Exception ex)
            {
                LittleWatson.ReportException(ex);
                SessionLog.CurrentScreen.RecordMilestone("GetInstalled Product Exception: giveaway", ex.Message);
                InstalledProductKind = ProductKind.Paid;
            }
                        #else
            InstalledProductKind = ProductKind.Free;
                        #endif
        }
Exemplo n.º 17
0
        private static bool getIsTrilaFromLicenseInformation()
        {
#if FAKESTORE
            return !_fakeActivated;
#elif TRIAL
            return true;
#else
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();
            return license.IsTrial();
#endif
        }
Exemplo n.º 18
0
        private void UpdateCachedTrialResult()
        {
#if Iron7Free
            CachedTrialResult = TrialResult.Trial;
#else
            if (CachedTrialResult == TrialResult.Unknown)
            {
                Microsoft.Phone.Marketplace.LicenseInformation license = new Microsoft.Phone.Marketplace.LicenseInformation();
                if (license.IsTrial())
                    CachedTrialResult = TrialResult.Trial;
                else
                    CachedTrialResult = TrialResult.Full;
            }
#endif
        }
Exemplo n.º 19
0
        /// <summary>
        /// Called when FeedbackLayout control is instantiated, which is
        /// supposed to happen when application's main page is instantiated.
        /// </summary>
        public void Launching()
        {
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();

            // Only load state if app is not trial, app is not activated after
            // being tombstoned, and state has not been loaded before.
            if (!license.IsTrial() &&
                PhoneApplicationService.Current.StartupMode == StartupMode.Launch &&
                State == FeedbackState.Active)
            {
                LoadData();
            }

            // Uncomment for testing
            // State = FeedbackState.FirstReview;
            // State = FeedbackState.SecondReview;
        }
Exemplo n.º 20
0
 private void DetermineIsTrail()
 {
     #if TRIAL
     IsTrial = true;
     #else
     var license = new Microsoft.Phone.Marketplace.LicenseInformation();
     IsTrial = license.IsTrial();
     #endif
     try
     {
         EmulatorSettings.Current.IsTrial = IsTrial;
     }
     catch (Exception) { }
 }
Exemplo n.º 21
0
        public static void ReloadTrialInfo()
        {
            if (IsFull)
            {
                if (Config.TrialStart == DateTime.MaxValue)
                    Config.TrialStart = DateTime.Now;

                var license = new Microsoft.Phone.Marketplace.LicenseInformation();
                IsTrial = license.IsTrial();
            }
            else
            {
                IsTrial = false;
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// Called when FeedbackLayout control is instantiated, which is
        /// supposed to happen when application's main page is instantiated.
        /// </summary>
        public void Launching()
        {
#if SILVERLIGHT		
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();
#else
			var license = Windows.ApplicationModel.Store.CurrentApp.LicenseInformation;
#endif
            // Only load state if app is not trial, app is not activated after
            // being tombstoned, and state has not been loaded before.
#if SILVERLIGHT		
            if (!license.IsTrial() && 
                PhoneApplicationService.Current.StartupMode == StartupMode.Launch && 
#else
            if (!license.IsTrial && 
#warning The app state is no longer checked, this needs a review
#endif
                State == FeedbackState.Active)
            {
                LoadState();
            }

            // Uncomment for testing
            // State = FeedbackState.FirstReview;
            // State = FeedbackState.SecondReview;
        }