コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindowViewModel"/> class.
        /// </summary>
        public MainWindowViewModel(ILicenseService licenseService, ILicenseValidationService licenseValidationService,
                                   IMessageService messageService, INetworkLicenseService networkLicenseService,
                                   ILicenseVisualizerService licenseVisualizerService, IUIVisualizerService uiVisualizerService)
        {
            Argument.IsNotNull(() => licenseService);
            Argument.IsNotNull(() => licenseValidationService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => networkLicenseService);
            Argument.IsNotNull(() => licenseVisualizerService);
            Argument.IsNotNull(() => uiVisualizerService);

            _licenseService           = licenseService;
            _licenseValidationService = licenseValidationService;
            _messageService           = messageService;
            _networkLicenseService    = networkLicenseService;
            _licenseVisualizerService = licenseVisualizerService;
            _uiVisualizerService      = uiVisualizerService;

            RemoveLicense                 = new Command(OnRemoveLicenseExecute);
            ValidateLicenseOnServer       = new TaskCommand(OnValidateLicenseOnServerExecuteAsync, OnValidateLicenseOnServerCanExecute);
            ValidateLicenseOnLocalNetwork = new TaskCommand(OnValidateLicenseOnLocalNetworkExecuteAsync, OnValidateLicenseOnLocalNetworkCanExecute);
            ShowLicense      = new Command(OnShowLicenseExecute);
            ShowLicenseUsage = new Command(OnShowLicenseUsageExecute);

            ServerUri = string.Format("http://localhost:1815/api/license/validate");
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindowViewModel"/> class.
        /// </summary>
        public MainWindowViewModel(ILicenseService licenseService, ILicenseValidationService licenseValidationService,
            IMessageService messageService, INetworkLicenseService networkLicenseService,
            ILicenseVisualizerService licenseVisualizerService, IUIVisualizerService uiVisualizerService)
        {
            Argument.IsNotNull(() => licenseService);
            Argument.IsNotNull(() => licenseValidationService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => networkLicenseService);
            Argument.IsNotNull(() => licenseVisualizerService);
            Argument.IsNotNull(() => uiVisualizerService);

            _licenseService = licenseService;
            _licenseValidationService = licenseValidationService;
            _messageService = messageService;
            _networkLicenseService = networkLicenseService;
            _licenseVisualizerService = licenseVisualizerService;
            _uiVisualizerService = uiVisualizerService;

            RemoveLicense = new Command(OnRemoveLicenseExecute);
            ValidateLicenseOnServer = new TaskCommand(OnValidateLicenseOnServerExecuteAsync, OnValidateLicenseOnServerCanExecute);
            ValidateLicenseOnLocalNetwork = new TaskCommand(OnValidateLicenseOnLocalNetworkExecuteAsync, OnValidateLicenseOnLocalNetworkCanExecute);
            ShowLicense = new Command(OnShowLicenseExecute);
            ShowLicenseUsage = new Command(OnShowLicenseUsageExecute);

            ServerUri = string.Format("http://localhost:1815/api/license/validate");
        }
コード例 #3
0
        public NetworkLicenseUsageViewModel(NetworkValidationResult networkValidationResult, ILicenseInfoService licenseInfoService,
                                            IProcessService processService, INetworkLicenseService networkLicenseService, IDispatcherService dispatcherService)
        {
            Argument.IsNotNull(() => networkValidationResult);
            Argument.IsNotNull(() => licenseInfoService);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => networkLicenseService);
            Argument.IsNotNull(() => dispatcherService);

            _licenseInfoService    = licenseInfoService;
            _processService        = processService;
            _networkLicenseService = networkLicenseService;
            _dispatcherService     = dispatcherService;

            var assembly = AssemblyHelper.GetEntryAssembly();

            Title       = assembly.Title() + " licence usage";
            PurchaseUrl = _licenseInfoService.GetLicenseInfo().PurchaseUrl;
            UpdateValidationResult(networkValidationResult, false);

            _dispatcherTimer.Interval = TimeSpan.FromSeconds(15);

            CloseApplication = new Command(OnCloseApplicationExecute);
            BuyLicenses      = new Command(OnBuyLicensesExecute);
        }
コード例 #4
0
        public NetworkLicenseUsageViewModel(NetworkValidationResult networkValidationResult, ILicenseInfoService licenseInfoService, 
            IProcessService processService, INetworkLicenseService networkLicenseService, IDispatcherService dispatcherService)
        {
            Argument.IsNotNull(() => networkValidationResult);
            Argument.IsNotNull(() => licenseInfoService);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => networkLicenseService);
            Argument.IsNotNull(() => dispatcherService);

            _licenseInfoService = licenseInfoService;
            _processService = processService;
            _networkLicenseService = networkLicenseService;
            _dispatcherService = dispatcherService;

            var assembly = AssemblyHelper.GetEntryAssembly();
            Title = assembly.Title() + " licence usage";
            PurchaseUrl = _licenseInfoService.GetLicenseInfo().PurchaseUrl;
            UpdateValidationResult(networkValidationResult, false);

            _dispatcherTimer.Interval = TimeSpan.FromSeconds(15);

            CloseApplication = new Command(OnCloseApplicationExecute);
            BuyLicenses = new Command(OnBuyLicensesExecute);
        }