Exemple #1
0
 public void Reload()
 {
     Licenses.Clear();
     foreach (var item in LicenseRepository.RetrieveAllLicenses(SpAgent.Product))
     {
         Licenses.Add(item);
     }
 }
Exemple #2
0
        public SubscriptionLicenseListModel()
        {
            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.RetrieveLicensesDueForRenewal(productContext));
            foreach (var license in Licenses)
            {
                license.ItemRenewalRequested += RenewSelectedItem;
            }
        }
Exemple #3
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()));
        }