public AvailableCheckoutsModel(IDisplayState displayState)
 {
     RefreshCommmand = new RelayCommand( Load );
     AcquireCheckoutCommand = new RelayCommand( AcquireCheckout, CanAcquireCheckout );
     DisplayState = displayState;
     Load();
 }
 public CurrentCheckoutModel(  )
 {
     Checkout.TryGetCurrent( out _checkout );
     ValidUntil = _checkout.ValidUntil;
     Features = new ObservableCollection<string>( _checkout.Features );
     CheckinCommand = new RelayCommand( Checkin );
 }
 public ConfigurationModel()
 {
     TestConnectionCommand = new RelayCommand( TestConnection, HasValidDistributorUrl );
     SaveCommand = new RelayCommand( Save, HasValidDistributorUrlOrEmpty );
     DistributorUrl = DistributorConfigurationRepository.Load();
     LicenseCount = LicenseRepository.LicenseCount( SpAgent.Product );
     ActivationCommand = new RelayCommand( () => DisplayState.Navigate( new ActivationPage() ) );
     ViewLicensesCommand = new RelayCommand( () => DisplayState.Navigate( new LicenseListPage() ) );
 }
Exemple #4
0
        public AcquireModel()
        {
            AcquireCommand = new RelayCommand( Acquire );

            // NB - RunFeatureCommand in this model is only available if a given feature is already held in current context.
            // If RunFeatureCommand isn't available for a given feature, the respective 'Feature X' button bound to this command will be disabled.
            RunFeatureCommand = new RelayCommand<string>( RunFeature, CanRunFeature, Convert.ToString );

            SpAgent.Product.Stores.LicenseInstalled += OnLicenseInstalled;
            SpAgent.Distributed.FeaturesUpdated += OnDistributedFeaturesUpdated;
        }
        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 LicenseItemModel()
 {
     RemoveLicenseCommand = new RelayCommand( RemoveLicense );
 }
 public OfflineActivationModel()
 {
     GenerateRequestCommand = new RelayCommand( GenerateRequest, CanGenerateRequest );
     CopyToClipboardCommand = new RelayCommand( CopyToClipboard, CanCopyToClipboard );
     BrowseAndInstallCommand = new RelayCommand( BrowseAndInstallLicense );
 }
 public ActivationModel()
 {
     ActivationCommand = new RelayCommand( ActivateOnline, CanActivate );
 }
 public ActivationModel()
 {
     ActivationCommand = new RelayCommand( ActivateOnline, CanActivate );
     CancelCommand = new RelayCommand( () => DisplayState.Navigate( new ConfigurationPage() ) );
 }
 public AvailableCheckoutsModel()
 {
     RefreshCommmand = new RelayCommand( Load );
     AcquireCheckoutCommand = new RelayCommand( AcquireCheckout, CanAcquireCheckout );
     Load();
 }