Пример #1
0
        public App()
        {
            // Глобальный обработчик неперехваченных исключений.
            UnhandledException += Application_UnhandledException;

            // Стандартная инициализация XAML
            InitializeComponent();

            AppHelper.IsTrial = _license.IsTrial();

            // Инициализация телефона
            InitializePhoneApplication();
        }
Пример #2
0
        public static bool IsTrialMode(bool forceRefresh)
        {
            if (DesignerProperties.IsInDesignTool)
            {
                return(false);
            }

            if (forceRefresh || (cachedIsTrialMode == null))
            {
#if DEBUG
                MessageBoxResult result = MessageBox.Show("Click ok to simulate paid version", "Simulate paid version?", MessageBoxButton.OKCancel);
                if (result == MessageBoxResult.OK)
                {
                    cachedIsTrialMode = false;
                }
                else
                {
                    cachedIsTrialMode = true;
                }
#else
                LicenseInformation licenseInfo = new LicenseInformation();
                cachedIsTrialMode = licenseInfo.IsTrial();
#endif
            }
            return(cachedIsTrialMode.Value);
        }
Пример #3
0
        public static void ShowTrialPopUp()
        {
            bool isTrail = _licenseInformation.IsTrial();

            // comment out before release!!
            //isTrail = true;

            if (isTrail)
            {
                try
                {
                    int    trailDaysLeft = getTrialDaysLeft();
                    string message       = String.Format(AppResources.trialPopup, trailDaysLeft);
                    if (MessageBox.Show(message, "Trial", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                    {
                        App._marketPlaceDetailTask.Show();
                        IsolatedStorageSettings.ApplicationSettings.Save();
                        Application.Current.Terminate();
                    }
                    else
                    {
                        if (trailDaysLeft == 0)
                        {
                            IsolatedStorageSettings.ApplicationSettings.Save();
                            Application.Current.Terminate();
                        }
                    }
                }
                catch (System.Collections.Generic.KeyNotFoundException)
                {
                    UserSettings.Add("installDate", DateTime.Now.Date);
                    IsolatedStorageSettings.ApplicationSettings.Save();
                }
            }
        }
Пример #4
0
        /// <summary>
        /// Check the current license information for this application
        /// </summary>
        private void CheckLicense()
        {
            //_isTrial = false;

            _isTrial = _licenseInfo.IsTrial();
            //_isTrial = false;
        }
        private void CheckTrial()
        {
            //Set up trial mode logic based on first run of app
            var fileStore = Mvx.Resolve <IMvxFileStore>();

            if (licenseInfo.IsTrial() || AppSettings.SimulateTrialMode)
            {
                if (fileStore.Exists("FirstLaunch"))
                {
                    string firstLaunch;
                    if (fileStore.TryReadTextFile("FirstLaunch", out firstLaunch))
                    {
                        var dateTimeOfFirstLaunch = DateTime.Parse(firstLaunch);
                        if ((DateTime.Now - dateTimeOfFirstLaunch).Days > AppSettings.TrialPeriodInDays)
                        {
                            TrialBlocker.Visibility = Visibility.Visible;
                        }
                    }
                }
                else
                {
                    fileStore.WriteFile("FirstLaunch", DateTime.Now.ToString());
                }
            }
        }
        // Load data for the ViewModel Items
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            LicenseInformation info = new LicenseInformation();
            #if DEBUG
            if (true)
            #else
            if (info.IsTrial())
            #endif
            {
                // running in trial mode
            #if DEBUG
                AdControl ac = new AdControl("TextAd", "test_client", true);
                // Other options in case you want to test other ads
                //AdControl ac = new AdControl("Image480_80", "test_client", true);
                //AdControl ac = new AdControl("Image300_50", "test_client", true);
            #else
                AdControl ac = new AdControl("012345", "01234567-1234-1234-1234-0123456789012", true);
            #endif
                ac.Width = 480;
                ac.Height = 80;

                AdControlHolder.Child = ac;
            }

            if (!App.ViewModel.IsDataLoaded)
            {
                App.ViewModel.LoadData();

            }
        }
Пример #7
0
        public void ChecekLicense()
        {
#if TRIAL
            IsTrial = true;
#else
            IsTrial = _license.IsTrial();
#endif
        }
Пример #8
0
        private void CheckLicense()
        {
#if DEBUG
            _isTrial = true;
#else
            _isTrial = _licenseInfo.IsTrial();
#endif
        }
Пример #9
0
        // Constructor
        public ItemsShowcaseView()
        {
            InitializeComponent();

            DataContext = new ItemsShowcaseViewModel();
            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
            SearchBox.TextChanged += SearchBox_TextChanged;
            Loaded += ItemsShowcaseView_Loaded;

            if (AppSettings.EnablePhoneBackground8X == true)
            {
                LayoutRoot.Background         = Application.Current.Resources["WallPaperBrush"] as ImageBrush;
                LayoutRoot.Background.Opacity = .5;
            }

            if (AppSettings.EnableAppPromoRatingReminder)
            {
                RateReminder rateReminder = new RateReminder();
                rateReminder.RunsBeforeReminder = AppSettings.NumberOfRunsBeforeRateReminder;
                LayoutRoot.Children.Add(rateReminder);
            }

            if (AppSettings.EnablePubcenterAdsPhone8)
            {
                if (AppSettings.HideAdsIfPurchasedPhone8)
                {
                    if (!licenseInfo.IsTrial())
                    {
                        return;
                    }
                }

                var advertisingControlPlaceholder = new RowDefinition();
                advertisingControlPlaceholder.Height = new GridLength(80);
                LayoutRoot.RowDefinitions.Add(advertisingControlPlaceholder);
                var appbarSpacer = new RowDefinition();
                appbarSpacer.Height = new GridLength(30);
                LayoutRoot.RowDefinitions.Add(appbarSpacer);
                AdControl adControl = new AdControl(AppSettings.PubcenterApplicationIdPhone8, AppSettings.PubcenterAdUnitIdPhone8, true);
                adControl.Width  = 480;
                adControl.Height = 80;
                Grid.SetRow(adControl, 2);
                LayoutRoot.Children.Add(adControl);
            }
        }
Пример #10
0
        /// <summary>
        /// Determine whether the app is running in trial mode and store the result
        /// into the static IsTrial property.
        /// </summary>
        private void RefreshLicenseInfo()
        {
#if DEBUG
            IsTrial = SimulateTrialMode;
#else
            LicenseInformation licenseInfo = new LicenseInformation();
            IsTrial = licenseInfo.IsTrial();
#endif
        }
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            LicenseInformation lic = new LicenseInformation();

            if (!lic.IsTrial())
            {
                GoToMainPage();
            }
        }
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            LicenseInformation lic = new LicenseInformation();

            if (!lic.IsTrial())
            {
                GoToMainPage();
            }
        }
Пример #13
0
        // Sprawdz licencje
        public void CheckLicense()
        {
#if TRIAL
            IsTrial = true;
#else
            // Zwróć licencje
            IsTrial = _license.IsTrial();
#endif
        }
Пример #14
0
        public static bool IsTrial()
        {
#if TRIAL
            return(true);
#else
            var license = new LicenseInformation();
            return(license.IsTrial());
#endif
        }
Пример #15
0
        /// <summary>
        /// Check the current license information for this application
        /// </summary>
        private void CheckLicense()
        {
            // When debugging, we want to simulate a trial mode experience. The following conditional allows us to set the _isTrial
            // property to simulate trial mode being on or off.
#if DEBUG
            _isTrial = false;
#else
            _isTrial = _licenseInfo.IsTrial();
#endif
        }
Пример #16
0
 //private void button1_Click(object sender, RoutedEventArgs e)
 //{
 //    border1.Visibility = Visibility.Collapsed;
 //}
 private void panoramaControl_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
 {
     LicenseInformation lic = new LicenseInformation();
     if (lic.IsTrial())
     {
         if (panoramaControl.SelectedIndex >= 2)
         {
             NavigationService.Navigate(new Uri("/BuyFullversion.xaml", UriKind.RelativeOrAbsolute));
         }
     }
 }
        // Sample code for building a localized ApplicationBar
        //private void BuildLocalizedApplicationBar()
        //{
        //    // Set the page's ApplicationBar to a new instance of ApplicationBar.
        //    ApplicationBar = new ApplicationBar();
        //    // Create a new button and set the text value to the localized string from AppResources.
        //    ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative));
        //    appBarButton.Text = AppResources.AppBarButtonText;
        //    ApplicationBar.Buttons.Add(appBarButton);
        //    // Create a new menu item with the localized string from AppResources.
        //    ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);
        //    ApplicationBar.MenuItems.Add(appBarMenuItem);
        //}
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            LicenseInformation licenseInfo = new LicenseInformation();
            bool isTrial = licenseInfo.IsTrial();
            if (isTrial)
                homePageButton.Content = "Buy this application";
            else
                homePageButton.Content = "Marketplace home";

            base.OnNavigatedTo(e);
        }
 public void isTrial(string options)
 {
     bool isTrial;
     #if DEBUG
     isTrial = true; // change this enable debugging in non-trial mode
     #else
     var licenseInfo = new LicenseInformation();
     isTrial = licenseInfo.IsTrial();
     #endif
     DispatchCommandResult(new PluginResult(PluginResult.Status.OK, "{\"trial\": " + isTrial.ToString().ToLower() + "}"));
 }
Пример #19
0
        public void isTrial(string options)
        {
            bool isTrial;

#if DEBUG
            isTrial = true; // change this enable debugging in non-trial mode
#else
            var licenseInfo = new LicenseInformation();
            isTrial = licenseInfo.IsTrial();
#endif
            DispatchCommandResult(new PluginResult(PluginResult.Status.OK, "{\"trial\": " + isTrial.ToString().ToLower() + "}"));
        }
Пример #20
0
        //private void button1_Click(object sender, RoutedEventArgs e)
        //{
        //    border1.Visibility = Visibility.Collapsed;
        //}



        private void panoramaControl_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
        {
            LicenseInformation lic = new LicenseInformation();

            if (lic.IsTrial())
            {
                if (panoramaControl.SelectedIndex >= 2)
                {
                    NavigationService.Navigate(new Uri("/BuyFullversion.xaml", UriKind.RelativeOrAbsolute));
                }
            }
        }
Пример #21
0
        private void CheckLicense()
        {
            if (!_appSettings.IsFullVersionSetting)
            {
                var licenseInfo = new LicenseInformation();
                if (!licenseInfo.IsTrial())
                {
                    _appSettings.IsFullVersionSetting = true;
                }
            }

            SetLicenseItems();
        }
Пример #22
0
        public static void Initialize()
        {
            if (_initialized)
            {
                return;
            }
            _initialized = true;

            // Determine whether we are running in trial mode
            LicenseInformation license = new LicenseInformation();

            IsTrial = license.IsTrial();

#if DEBUG
            if (SimulateTrialMode)
            {
                IsTrial = true;
            }
#endif

            // Start the trial if we need to
            if (IsTrial && TrialExpirationDate == null && AutoStartTrial)
            {
                StartTrial();
            }

            // Reset the trial expiration date upon upgrading to a new version
            if (ResetTrialExpirationDateOnNewVersion)
            {
                if (TrialExpirationDate != null && _trialExpirationVersion.Value != Utility.ApplicationVersion)
                {
                    ResetTrialExpirationDate();
                }
            }

            // Update trial state and days remaining
            UpdateTrialState();

            _log.Info("Current state: {0}", TrialState);
            if (IsTrial)
            {
                if (TrialExpirationDate != null)
                {
                    _log.Info("Trial expiration date: {0:d} ({1} day(s) remaining)", TrialExpirationDate, TrialDaysRemaining);
                }
                else
                {
                    _log.Info("Trial expiration date is null.");
                }
            }
        }
Пример #23
0
        /// <summary>
        /// Check the current license information for this application
        /// </summary>
        private void CheckLicense()
        {
            try
            {
                //_isTrial = false;

                _isTrial = _licenseInfo.IsTrial();
                //_isTrial = true;
            }
            catch (Exception)
            {
                _isTrial = false;
            }
        }
Пример #24
0
        // Sample code for building a localized ApplicationBar
        //private void BuildLocalizedApplicationBar()
        //{
        //    // Set the page's ApplicationBar to a new instance of ApplicationBar.
        //    ApplicationBar = new ApplicationBar();

        //    // Create a new button and set the text value to the localized string from AppResources.
        //    ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative));
        //    appBarButton.Text = AppResources.AppBarButtonText;
        //    ApplicationBar.Buttons.Add(appBarButton);

        //    // Create a new menu item with the localized string from AppResources.
        //    ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);
        //    ApplicationBar.MenuItems.Add(appBarMenuItem);
        //}

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            LicenseInformation licenseInfo = new LicenseInformation();
            bool isTrial = licenseInfo.IsTrial();

            if (isTrial)
            {
                homePageButton.Content = "Buy this application";
            }
            else
            {
                homePageButton.Content = "Marketplace home";
            }

            base.OnNavigatedTo(e);
        }
Пример #25
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            LicenseInformation lic = new LicenseInformation();

            if (lic.IsTrial() == false)
            {
                textBlock1.Text       = "You are running trial version of our software !";
                btnUpgrade.Visibility = Visibility.Visible;
                btnCancel.Visibility  = Visibility.Visible;
            }
            else
            {
                textBlock1.Text = "Thank you for using Full-Version of our software !";
            }
        }
        // Constructor
        public HelloPage()
        {
            InitializeComponent();
            globeBrush = (SolidColorBrush)ContentPanel.Resources["GlobeBrush"];

            LicenseInformation licenseInfo = new LicenseInformation();
            #if TRIAL_LICENSE
            bool isInTrialMode = true;
            #else
            bool isInTrialMode = licenseInfo.IsTrial();
            #endif
            if (isInTrialMode)
            {
                ApplicationTitle.Text += " (TRIAL)";
            }
        }
Пример #27
0
        public AppInfoPage()
        {
            InitializeComponent();

            if (LicenseInfo.IsTrial())
            {
                TextBlock_PurchaseStatus.Text     = "Status:        Trial";
                TextBlock_Notification.Visibility = Visibility.Visible;
            }
            else
            {
                TextBlock_PurchaseStatus.Text     = "Status:        Purchased";
                Button_Purchase.Visibility        = Visibility.Collapsed;
                TextBlock_Notification.Visibility = Visibility.Collapsed;
            }
        }
        // Constructor
        public HelloPage()
        {
            InitializeComponent();
            globeBrush = (SolidColorBrush)ContentPanel.Resources["GlobeBrush"];

            LicenseInformation licenseInfo = new LicenseInformation();

#if TRIAL_LICENSE
            bool isInTrialMode = true;
#else
            bool isInTrialMode = licenseInfo.IsTrial();
#endif
            if (isInTrialMode)
            {
                ApplicationTitle.Text += " (TRIAL)";
            }
        }
Пример #29
0
        public App()
        {
            // Глобальный обработчик неперехваченных исключений.
            UnhandledException += Application_UnhandledException;

            // Стандартная инициализация XAML
            InitializeComponent();

            AppHelper.IsTrial = _license.IsTrial();

            if (!AppHelper.IsTrial)
            {
                AdDuplex.AdDuplexTrackingSDK.StartTracking("1a27bbd1-5f82-4561-b93c-1c65d4ea1984");
            }

            // Инициализация телефона
            InitializePhoneApplication();
        }
Пример #30
0
        public static bool IsTryMode()
        {
            LicenseInformation license = new LicenseInformation();

            if (license.IsTrial())
            {
                int startcount = Settings.Read <int>("startcount", 1);

                if (startcount > 4)
                {
                    return(true);
                }

                Settings.Write <int>("startcount", startcount + 1);
            }

            return(false);
        }
Пример #31
0
        private bool CheckIsTrial()
        {
#if DEBUG
            MessageBoxResult result = MessageBox.Show("OK는 정식판", "Cancel은 평가판", MessageBoxButton.OKCancel);

            if (result == MessageBoxResult.OK)
            {
                return(false);
            }
            else
            {
                return(true);
            }
#else
            //RELEASE모드
            return(licenseInfo.IsTrial());
#endif
        }
Пример #32
0
        /// <summary>
        /// Check the current license information for this application
        /// </summary>
        private static void CheckLicense()
        {
            // When debugging, we want to simulate a trial mode experience. The following conditional allows us to set the _isTrial
            // property to simulate trial mode being on or off.
#if DEBUG
            string message = "Press 'OK' to simulate trial mode. Press 'Cancel' to run the application in normal mode.";
            if (MessageBox.Show(message, "Debug Trial",
                                MessageBoxButton.OKCancel) == MessageBoxResult.OK)
            {
                m_isTrial = true;
            }
            else
            {
                m_isTrial = false;
            }
#else
            m_isTrial = m_licenseInfo.IsTrial();
#endif
        }
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();

            globeBrush = (SolidColorBrush)ContentPanel.Resources["GlobeBrush"];

            LicenseInformation licenseInfo = new LicenseInformation();
            #if TRIAL_LICENSE
            bool isInTrialMode = true;
            #else
            bool isInTrialMode = licenseInfo.IsTrial();
            #endif
            if (isInTrialMode)
            {
                ApplicationTitle.Text += " (TRIAL)";
            }
        }
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();

            globeBrush = (SolidColorBrush)ContentPanel.Resources["GlobeBrush"];

            LicenseInformation licenseInfo = new LicenseInformation();

#if TRIAL_LICENSE
            bool isInTrialMode = true;
#else
            bool isInTrialMode = licenseInfo.IsTrial();
#endif
            if (isInTrialMode)
            {
                ApplicationTitle.Text += " (TRIAL)";
            }
        }
Пример #35
0
        protected void AppointmentsSearchCompleted(object sender, AppointmentsSearchEventArgs e)
        {
            var licenseInfo = new LicenseInformation();

            if (!licenseInfo.IsTrial())
            {
                var appointment = Calendar.GetAppointment(e);
                if (appointment == null)
                {
                    return;
                }

                LiveTile.Update(appointment.Subject, appointment.Location, appointment.DateAndTime, Battery, AppSettings);
            }
            else
            {
                LiveTile.Update("Sample Calendar Item", "Get full version", "to display calendar items", Battery, AppSettings);
            }

            // Call NotifyComplete to let the system know the agent is done working.
            NotifyComplete();
        }
Пример #36
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     Loaded += (sender, e) =>
     {
         var li = new LicenseInformation();
         if (!li.IsTrial())
         {
             MyAdControl.Visibility = Visibility.Collapsed;
         }
         var ints = new List<string>();
         for (int i = 1; i < 150; i++)
         {
             ints.Add(i.ToString());
         }
         var ds = new LoopingSelectorDataSource<string>(ints);
         NumberOfQuestions.DataSource = ds;
         var initialValue = RetrieveInitialValue();
         ds.SelectedItem = initialValue.ToString();
         Calculate(initialValue);
     };
 }
Пример #37
0
        public static bool IsTrialMode(bool forceRefresh)
        {
            if (DesignerProperties.IsInDesignTool)
                return false;

            if (forceRefresh || (cachedIsTrialMode == null))
            {
            #if DEBUG
                   MessageBoxResult result = MessageBox.Show("Click ok to simulate paid version", "Simulate paid version?", MessageBoxButton.OKCancel);
                if (result == MessageBoxResult.OK)
                {
                cachedIsTrialMode = false;
                }
                else
                {
                cachedIsTrialMode = true;
                }
            #else
                LicenseInformation licenseInfo = new LicenseInformation();
                cachedIsTrialMode = licenseInfo.IsTrial();
            #endif
            }
            return cachedIsTrialMode.Value;
        }
Пример #38
0
        /// <summary>
        /// Check the current license information for this application
        /// </summary>
        private void CheckLicense()
        {
            // When debugging, we want to simulate a trial mode experience. The following conditional allows us to set the _isTrial
            // property to simulate trial mode being on or off.
#if DEBUG
            //_isTrial = true;



            //string message = "This sample demonstrates the implementation of a trial mode in an application." +
            //                   "Press 'OK' to simulate trial mode. Press 'Cancel' to run the application in normal mode.";
            //if (MessageBox.Show(message, "Debug Trial",
            //     MessageBoxButton.OKCancel) == MessageBoxResult.OK)
            //{
            //    _isTrial = true;
            //}
            //else
            //{
            //    _isTrial = false;
            //}
#else
            _isTrial = _licenseInfo.IsTrial();
#endif
        }
Пример #39
0
 public bool IsTrial()
 {
     var license = new LicenseInformation();
     return license.IsTrial();
 }
Пример #40
0
 /// <summary>
 /// Check the current license information for this application
 /// </summary>
 private void CheckLicense()
 {
     _isTrial = _licenseInfo.IsTrial();
 }