示例#1
0
        public LicensesViewModel(ILicenseProvider licenseProvider)
        {
            Ensure.Argument.IsNotNull(licenseProvider, nameof(licenseProvider));

            Licenses = licenseProvider.GetAppLicenses()
                       .Select(keyValuePair => new License(keyValuePair.Key, keyValuePair.Value))
                       .ToImmutableList();
        }
示例#2
0
		private static void CheckLicenseProvider()
		{
			if (_licenseProvider != null) return;

			lock (_syncRoot)
			{
				if (_licenseProvider != null) return;
				_licenseProvider = LicenseProviderExtensionPoint.CreateInstance();
				_licenseProvider.LicenseInfoChanged += (s, e) => EventsHelper.Fire(_licenseChanged, null, e);
			}
		}
示例#3
0
        public static Foundation Create(
            string clientName,
            string version,
            ITogglDatabase database,
            ITimeService timeService,
            IScheduler scheduler,
            IMailService mailService,
            IGoogleService googleService,
            ApiEnvironment apiEnvironment,
            ILicenseProvider licenseProvider,
            IAnalyticsService analyticsService,
            IPlatformConstants platformConstants,
            IApplicationShortcutCreator shortcutCreator,
            ISuggestionProviderContainer suggestionProviderContainer)
        {
            Ensure.Argument.IsNotNull(version, nameof(version));
            Ensure.Argument.IsNotNull(database, nameof(database));
            Ensure.Argument.IsNotNull(clientName, nameof(clientName));
            Ensure.Argument.IsNotNull(timeService, nameof(timeService));
            Ensure.Argument.IsNotNull(scheduler, nameof(scheduler));
            Ensure.Argument.IsNotNull(mailService, nameof(mailService));
            Ensure.Argument.IsNotNull(googleService, nameof(googleService));
            Ensure.Argument.IsNotNull(licenseProvider, nameof(licenseProvider));
            Ensure.Argument.IsNotNull(shortcutCreator, nameof(shortcutCreator));
            Ensure.Argument.IsNotNull(analyticsService, nameof(analyticsService));
            Ensure.Argument.IsNotNull(platformConstants, nameof(platformConstants));
            Ensure.Argument.IsNotNull(suggestionProviderContainer, nameof(suggestionProviderContainer));

            var userAgent = new UserAgent(clientName, version.ToString());

            var foundation = new Foundation
            {
                Database                    = database,
                UserAgent                   = userAgent,
                TimeService                 = timeService,
                Scheduler                   = scheduler,
                MailService                 = mailService,
                GoogleService               = googleService,
                ApiEnvironment              = apiEnvironment,
                LicenseProvider             = licenseProvider,
                Version                     = Version.Parse(version),
                ShortcutCreator             = shortcutCreator,
                AnalyticsService            = analyticsService,
                PlatformConstants           = platformConstants,
                BackgroundService           = new BackgroundService(timeService),
                ApiFactory                  = new ApiFactory(apiEnvironment, userAgent),
                SuggestionProviderContainer = suggestionProviderContainer
            };

            return(foundation);
        }
示例#4
0
        private static void CheckLicenseProvider()
        {
            if (_licenseProvider != null)
            {
                return;
            }

            lock (_syncRoot)
            {
                if (_licenseProvider != null)
                {
                    return;
                }
                _licenseProvider = LicenseProviderExtensionPoint.CreateInstance();
                _licenseProvider.LicenseInfoChanged += (s, e) => EventsHelper.Fire(_licenseChanged, null, e);
            }
        }
示例#5
0
 public Builder WithLicenseProvider(ILicenseProvider licenseProvider)
 {
     LicenseProvider = licenseProvider;
     return(this);
 }
示例#6
0
 public LicensesController(ILicenseProvider licenseProvider, MainViewModel mainViewModel, IStepProvider stepProvider, string stepName, ILoggerFactory loggerFactory)
     : base(mainViewModel, stepProvider, stepName, loggerFactory)
 {
     LicenseProvider = licenseProvider;
 }
示例#7
0
        public LicensesViewModel(ILicenseProvider licenseProvider)
        {
            Ensure.Argument.IsNotNull(licenseProvider, nameof(licenseProvider));

            this.licenseProvider = licenseProvider;
        }
示例#8
0
 public UsageTracker(ILicenseProvider provider, ITransportService transportService)
 {
     this.LicenseProvider  = provider;
     this.TransportService = transportService;
 }