예제 #1
0
        public ConfigurationModel()
        {
            _distributorUrl = DistributorConfigurationRepository.Load();
            _licenseCount   = LicenseRepository.LicenseCount(SpAgent.Product);

            TestConnectionCommand = new RelayCommand(TestConnection, HasValidDistributorUrl);
            SaveCommand           = new RelayCommand(Save, CanSave);
            ActivationCommand     = new RelayCommand(() => DisplayState.Navigate(new ActivationPage()));
            ViewLicensesCommand   = new RelayCommand(() => DisplayState.Navigate(new LicenseListPage()));
        }
예제 #2
0
        public LicenseListModel()
        {
            IProductContext productContext = SpAgent.Product;

            ProductName    = productContext.ProductName;
            ProductVersion = productContext.ProductVersion;

            // If there's no product context, then probably SpAgent hasn't been initialized
            // (this can happen inside Visual Studio Designer)
            if (productContext == null)
            {
                return;
            }

            Licenses = new ObservableCollection <LicenseItemModel>(LicenseRepository.RetrieveAllLicenses(productContext));
            foreach (var license in Licenses)
            {
                license.ItemRemoved += RemoveSelectedItem;
            }
            BackCommand = new RelayCommand(() => DisplayState.Navigate(new ConfigurationPage()));
        }
 public void AcquireCheckout()
 {
     try
     {
         SelectedAvailableCheckout.Acquire(AcquireCheckoutUntil);
         DisplayState.Navigate(new CurrentCheckoutPage());
     }
     catch (NoLongerAvailableException)
     {
         DisplayState.NotifyUser("The requested checkout is no longer available. Please refresh the list above and select another available chekcout.");
     }
     catch (DistributorRequestException)
     {
         DisplayState.NotifyUser("There has been an issue contacting your distributor server. Please try again. If the problem persists, please contact your system administrator.");
     }
     catch (DistributorIntegrityException)
     {
         DisplayState.NotifyUser("We have detected an integrity issue with your distributor server. Please contact your system administrator.");
     }
     catch (Exception exc)
     {
         DisplayState.NotifyUser("Error: " + exc.Message);
     }
 }
예제 #4
0
 public ActivationModel()
 {
     ActivationCommand = new RelayCommand(ActivateOnline, CanActivate);
     CancelCommand     = new RelayCommand(() => DisplayState.Navigate(new ConfigurationPage()));
 }