public EnterpriseTesterRaygunMessageBuilderFactory(IUserContext userContext, ILicenseManager licenseManager)
 {
     if (userContext == null) throw new ArgumentNullException("userContext");
     if (licenseManager == null) throw new ArgumentNullException("licenseManager");
     _userContext = userContext;
     _licenseManager = licenseManager;
 }
 public LicenseRegistrationViewModel(
     ILicenseManager licenseManager, 
     IDialogManager dialogManager,
     INetworkOperations network)
 {
     _licenseManager = licenseManager;
     _dialogManager = dialogManager;
     _network = network;
 }
Example #3
0
		public void MailManagerTest_InitTest()
		{
			base.InitDbContext();

			this.UserRepository = new UserRepository(this.DbFactory);
			this.ReferenceRepository = new ReferenceRepository(this.DbFactory);
			this.CacheService = new FakeCacheService();
			this.ReferenceManagement = new ReferenceManagement(this.ReferenceRepository, this.CacheService);
			this.ResetPasswordRepository = Substitute.For<IResetPasswordRepository>();
			this.UsersManager = new UserManagement(this.UserRepository, this.ReferenceManagement, this.ResetPasswordRepository, this.CacheService, null);
			this.DocumentService = Substitute.For<IDocumentService>();

			this.Target = new LicenseManager(this.ReferenceManagement, this.DocumentService, this.UsersManager);
		}
        /// <summary>
        /// Initializes a new instance of the ActivatedStateViewModel class.
        /// </summary>
        /// <param name="licenseManager">The reference to the license manager
        /// object providing necessary license information.</param>
        /// <param name="licensePageCommands">The reference to the common license
        /// page command container object.</param>
        /// <param name="showExpirationWarning">A value indicating if the license
        /// expiration warning should be displayed.</param>
        public ActivatedStateViewModel(
            ILicenseManager licenseManager,
            ILicensePageCommands licensePageCommands,
            bool showExpirationWarning)
        {
            Debug.Assert(licenseManager != null);
            Debug.Assert(licensePageCommands != null);

            this.UpgradeLicenseCommand = licensePageCommands.UpgradeLicense;
            this.ShowExpirationWarning = showExpirationWarning;

            var license = licenseManager.AppLicense;
            var currentDate = licenseManager.AppLicenseValidationDate;
            _InitContent(license, currentDate);
        }
        /// <summary>
        /// Initializes a new instance of the ExpiredStateViewModel class.
        /// </summary>
        /// <param name="licenseManager">The reference to the license manager
        /// object providing necessary license information.</param>
        /// <param name="licensePageCommands">The reference to the common license
        /// page command container object.</param>
        public ExpiredStateViewModel(
            ILicenseManager licenseManager,
            ILicensePageCommands licensePageCommands,
            Action startSingleVehicleMode)
        {
            Debug.Assert(licenseManager != null);
            Debug.Assert(licensePageCommands != null);
            Debug.Assert(startSingleVehicleMode != null);

            this.UpgradeLicenseCommand = licensePageCommands.UpgradeLicense;
            this.SingleVehicleModeCommand = new DelegateCommand(
                _ => startSingleVehicleMode());

            _InitContent(licenseManager.ExpiredLicense);
        }
        public void OnStartUp()
        {
            configuration               = new Configuration();
            configuration.PostURL       = "https://bluebyte.biz";
            configuration.ActivationKey = "5dac72c4d41999.62508674";
            configuration.SecretKey     = "5dac72c4d41910.86584044";

            licenseManager = LicenseManagerFactory.New(configuration);


            license                      = new License();
            license.Email                = "*****@*****.**";
            license.Key                  = "5db3244aef396";
            license.FirstName            = "Amen";
            license.LastName             = "Jlili";
            license.CompanyName          = "Blue Byte LLC";
            license.MaximumDomainAllowed = 1;
        }
        public void Setup()
        {
            // a simple logger that writes to the console (NUnit Text output tab).
            _mockLog = new Mock<ILog>();
            _mockLog.Setup(l => l.Info(It.IsAny<string>(), It.IsAny<string[]>())).Callback((object s, string[] a) => Console.WriteLine("Info:" + s));
            _mockLog.Setup(l => l.Fatal(It.IsAny<string>(), It.IsAny<string[]>())).Callback((object s, string[] a) => Console.WriteLine("Fatal:" + s));
            _mockLog.Setup(l => l.Error(It.IsAny<string>(), It.IsAny<string[]>())).Callback((object s, string[] a) => Console.WriteLine("Error:" + s));
            _mockLog.Setup(l => l.Warn(It.IsAny<string>(), It.IsAny<string[]>())).Callback((object s, string[] a) => Console.WriteLine("Warn:" + s));
            _mockLog.Setup(l => l.Debug(It.IsAny<string>(), It.IsAny<string[]>())).Callback((object s, string[] a) => Console.WriteLine("Debug:" + s));

            _mockConfig = new Mock<ILicenseConfiguration>();
            _mockServer = new Mock<ILicenseServer>();
            _mockNotifier = new Mock<INotificationDispatcher>();
            _mockStore = new Mock<ILicenseStore>();
            _mockVerifier = new Mock<ISignatureVerifier>();
            _mockClock = new Mock<MEDSEEK.eHealth.Framework.Licensing.Common.IClock>();

            _licenseManager = new LicenseManager(_mockServer.Object, _mockStore.Object, _mockConfig.Object, _mockVerifier.Object, _mockNotifier.Object, _mockClock.Object, _mockLog.Object);
        }
        public MessageService(IServiceProvider serviceProvider)
        {
            _cancellationSource = new CancellationTokenSource();

            _appConfig      = serviceProvider.GetRequiredService <IAppSettingsConfig>();
            _connConfig     = serviceProvider.GetRequiredService <IConnectionStringsConfig>();
            _busSettings    = serviceProvider.GetRequiredService <BusSettings>();
            _logger         = serviceProvider.GetRequiredService <ILogger>();
            _database       = serviceProvider.GetRequiredService <IBusDatabase>();
            _dataAdapter    = serviceProvider.GetRequiredService <IBusDataAdapter>();
            _authManager    = serviceProvider.GetRequiredService <IAuthManager>();
            _channelManager = serviceProvider.GetRequiredService <IChannelManager>();
            _addinManager   = serviceProvider.GetRequiredService <IAddinManager>();
            _licManager     = serviceProvider.GetRequiredService <ILicenseManager>();
            _serviceInfo    = serviceProvider.GetRequiredService <ServiceInfo>();
            //_serviceInfoManager = serviceProvider.GetRequiredService<IServiceInfoManager>();

            SetCurrentParamsTo(_serviceInfo);
        }
Example #9
0
        public ShellViewModel(
            IAppCommands appCommander,
            IScreenFactory screenFactory,
            IWindowManagerEx windowManager,
            IQueueExplorerViewModel queueExplorer,
            IEndpointExplorerViewModel endpointExplorer,
            IMessageListViewModel messages,
            IStatusBarManager statusBarManager,
            IEventAggregator eventAggregator,
            ILicenseManager licenseManager,
            IMessageFlowViewModel messageFlow,
            IMessageBodyViewModel messageBodyViewer,
            ISettingsProvider settingsProvider,
            IMessagePropertiesViewModel messageProperties,
            ILogWindowViewModel logWindow)
        {
            _appCommander     = appCommander;
            _screenFactory    = screenFactory;
            _windowManager    = windowManager;
            _eventAggregator  = eventAggregator;
            _licenseManager   = licenseManager;
            _settingsProvider = settingsProvider;
            MessageProperties = messageProperties;
            MessageFlow       = messageFlow;
            StatusBarManager  = statusBarManager;
            QueueExplorer     = queueExplorer;
            EndpointExplorer  = endpointExplorer;
            MessageBody       = messageBodyViewer;
            Messages          = messages;
            LogWindow         = logWindow;

            Items.Add(endpointExplorer);
            Items.Add(messageBodyViewer);
            Items.Add(messageFlow);
            Items.Add(queueExplorer);
            Items.Add(messages);

            InitializeAutoRefreshTimer();
            InitializeIdleTimer();
        }
Example #10
0
 public InvoiceService(AppDbContext dbContext,
                       IWorkContext workContext,
                       IUsersService usersService,
                       IUserGroupsService userGroupsService,
                       IProductService productService,
                       IProductCheckoutAttributesService productCheckoutAttributesService,
                       ITaxesService taxesService,
                       IPluginFinder pluginFinder,
                       ILicenseManager licenseManager,
                       ISettingService settingService,
                       IEventPublisher eventPublisher)
 {
     _dbContext         = dbContext;
     _workContext       = workContext;
     _usersService      = usersService;
     _userGroupsService = userGroupsService;
     _productService    = productService;
     _productCheckoutAttributesService = productCheckoutAttributesService;
     _taxesService   = taxesService;
     _pluginFinder   = pluginFinder;
     _licenseManager = licenseManager;
     _settingService = settingService;
     _eventPublisher = eventPublisher;
 }
Example #11
0
 public LicensedPlugin(ILicenseManager mgr, ILicenseClock clock, params string[] codes)
 {
     this.codes = codes;
     this.mgr   = mgr;
     Clock      = clock ?? Clock;
 }
 public LicenseService(ILicenseManager officeLicenseManager)
 {
     _officeLincenseManager = officeLicenseManager;
 }
        /// <summary>
        /// Initializes a new instance of the LicensePageModel class.
        /// </summary>
        /// <param name="servers">Collection of servers to provide separate
        /// authentication for.</param>
        /// <param name="messenger">The messenger object to be used for
        /// notifications.</param>
        /// <param name="workingStatusController">The object to be used for
        /// managing application working status.</param>
        /// <param name="uriNavigator">The reference to the object to be used
        /// for navigating to URI's.</param>
        public LicensePageModel(
            IEnumerable<AgsServer> servers,
            IMessenger messenger,
            IWorkingStatusController workingStatusController,
            IUriNavigator uriNavigator,
            ILicenseManager licenseManager)
        {
            Debug.Assert(servers != null);
            Debug.Assert(servers.All(server => server != null));
            Debug.Assert(messenger != null);
            Debug.Assert(workingStatusController != null);
            Debug.Assert(licenseManager != null);

            _licenseManager = licenseManager;
            _licenseExpirationChecker = _licenseManager.LicenseExpirationChecker;

            var items = new ObservableCollection<LoginViewModelBase>();

            var licensingViewModel = new LicensingViewModel(
                messenger,
                workingStatusController,
                uriNavigator,
                licenseManager);
            this.RequiresExpirationWarning = licensingViewModel.RequiresExpirationWarning;
            licensingViewModel.PropertyChanged += delegate
            {
                this.RequiresExpirationWarning = licensingViewModel.RequiresExpirationWarning;
                _UpdateCompletedState();
            };

            items.Add(licensingViewModel);

            _servers = servers.ToList();
            foreach (var server in _servers)
            {
                items.Add(new ArcGisServerLoginViewModel(
                    server,
                    messenger,
                    workingStatusController));
                server.StateChanged += delegate
                {
                    _UpdateCompletedState();
                };
            }

            this.LoginViewModels = new ReadOnlyObservableCollection<LoginViewModelBase>(items);
            _UpdateCompletedState();
            _UpdateLoggedInState();

            foreach (var vm in this.LoginViewModels)
            {
                vm.LoginState.LoginViewHost = this;
                vm.PropertyChanged += delegate
                {
                    _UpdateLoggedInState();
                };
            }
        }
        /// <summary>
        /// Initializes a new instance of the LicensingViewModel class.
        /// </summary>
        /// <param name="messenger">The messenger object to be used for
        /// notifications.</param>
        /// <param name="workingStatusController">The object to be used for
        /// managing application working status.</param>
        /// <param name="uriNavigator">The reference to the object to be used
        /// for navigating to URI's.</param>
        /// <param name="licenseManager">The reference to the license manager
        /// object.</param>
        public LicensingViewModel(
            IMessenger messenger,
            IWorkingStatusController workingStatusController,
            IUriNavigator uriNavigator,
            ILicenseManager licenseManager)
        {
            Debug.Assert(messenger != null);
            Debug.Assert(workingStatusController != null);
            Debug.Assert(uriNavigator != null);
            Debug.Assert(licenseManager != null);

            _licenseManager = licenseManager;
            _licenseExpirationChecker = licenseManager.LicenseExpirationChecker;
            _messenger = messenger;
            _workingStatusController = workingStatusController;
            _uriNavigator = uriNavigator;

            _licensePageCommands = new LicensePageCommands()
            {
                CreateAccount = _CreateUrlNavigationCommand(
                    _licenseManager.LicenseComponent.CreateAccountURL,
                    _uriNavigator),
                RecoverCredentials = _CreateUrlNavigationCommand(
                    _licenseManager.LicenseComponent.RecoverCredentialsURL,
                    _uriNavigator),
                UpgradeLicense = _CreateUrlNavigationCommand(
                    _licenseManager.LicenseComponent.UpgradeLicenseURL,
                    _uriNavigator),
            };

            this.LicenseActivationStatus = _licenseManager.LicenseActivationStatus;
            this.LicenseState = this.LicenseActivationStatus == LicenseActivationStatus.Activated ?
                AgsServerState.Authorized : AgsServerState.Unauthorized;
            _UpdateExpirationWarningDisplayState();

            foreach (var item in EnumHelpers.GetValues<AgsServerState>())
            {
                this.RegisterHeader(
                    item,
                    _licenseManager.LicenseComponent.LoginPrompt);
            }

            _CreateLoginState();
            _CreateConnectedState();
            _CreateNotConnectedState();

            this.LicensingNotes = _CreateLicensingNotes(
                _licenseManager.LicenseComponent.LicensingNotes);
            this.TroubleshootingNotes = _CreateTroubleshootingNotes(
                _licenseManager.LicenseComponent.TroubleshootingNotes);

            _stateFactories = new Dictionary<LicenseActivationStatus, Func<LicenseActivationViewState>>()
            {
                {
                    LicenseActivationStatus.None,
                    () => new LicenseActivationViewState
                    {
                        LoginViewState = this.LoginState,
                        InformationViewState = (object)null,
                    }
                },
                {
                    LicenseActivationStatus.Activated,
                    () => new LicenseActivationViewState
                    {
                        LoginViewState = this.ConnectedState,
                        InformationViewState = _CreateActivatedState(),
                    }
                },
                {
                    LicenseActivationStatus.Expired,
                    () => new LicenseActivationViewState
                    {
                        LoginViewState = this.LoginState,
                        InformationViewState = _CreateExpiredState(),
                    }
                },
                {
                    LicenseActivationStatus.WrongCredentials,
                    () => new LicenseActivationViewState
                    {
                        LoginViewState = this.LoginState,
                        InformationViewState = _CreateWrongCredentialsState(),
                    }
                },
                {
                    LicenseActivationStatus.NoSubscription,
                    () => new LicenseActivationViewState
                    {
                        LoginViewState = this.LoginState,
                        InformationViewState = _CreateNoSubscriptionState(),
                    }
                },
                {
                    LicenseActivationStatus.Failed,
                    () => new LicenseActivationViewState
                    {
                        LoginViewState = this.NotConnectedState,
                        InformationViewState = (object)null,
                    }
                },
            };
        }
Example #15
0
 public VeeamLicenseManager_Tests()
 {
     _licenseManager = LocalIocManager.Resolve <ILicenseManager>();
     _licenseManager.SetLicenseFile(_exampleLicense);
 }
 public void TestFixtureSetUp()
 {
     currentLicenseManager = App.Current.LicenseManager;
 }
 public ViewManager(ILicenseManager licenseManager, IValidationManger validationManger)
 {
     _validationManger = validationManger;
     _licenseManager   = licenseManager;
 }
 public TerminalMiddleware(RequestDelegate next, IOptions <SiteConfig> siteConfig, ILicenseManager licenseManager)
 {
     this.next           = next;
     this.licenseManager = licenseManager;
     this.siteConfig     = siteConfig;
 }
        public void TestInitialize()
        {
            ScreenFactory = Substitute.For<IScreenFactory>();
            WindowManager = Substitute.For<IWindowManagerEx>();
            QueueExplorer = Substitute.For<IQueueExplorerViewModel>();
            EndpointExplorer = Substitute.For<IEndpointExplorerViewModel>();
            MessageList = Substitute.For<IMessageListViewModel>();
            NetworkOperations = Substitute.For<INetworkOperations>();
            ExceptionHandler = Substitute.For<IExceptionHandler>();
            StatusbarManager = Substitute.For<StatusBarManager>();
            EventAggregator = Substitute.For<IEventAggregator>();
            MessageFlow = Substitute.For<IMessageFlowViewModel>();
            MessageBodyView = Substitute.For<IMessageBodyViewModel>();
            MessageProperties = Substitute.For<IMessagePropertiesViewModel>();
            View = Substitute.For<IShellViewStub>();
            SettingsProvider = Substitute.For<ISettingsProvider>();
            LicenseManager = Substitute.For<ILicenseManager>();
            LogWindow = Substitute.For<ILogWindowViewModel>();
            ConnectToViewModel = Substitute.For<ConnectToMachineViewModel>(NetworkOperations);
            SettingsProvider.GetSettings<ProfilerSettings>().Returns(DefaultAppSetting());
            App = Substitute.For<IAppCommands>();
            shell = new ShellViewModel(App, ScreenFactory, WindowManager, QueueExplorer, EndpointExplorer, MessageList,
                                       StatusbarManager, EventAggregator, LicenseManager, MessageFlow, MessageBodyView,
                                       SettingsProvider, MessageProperties, LogWindow);

            ScreenFactory.CreateScreen<ConnectToMachineViewModel>().Returns(ConnectToViewModel);

            shell.AttachView(View, null);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ThrottleActionFilter"/> class.
 /// </summary>
 public ThrottleActionFilter(ThrottleService throttleService, SiteConfig siteConfig, ILicenseManager licenseManager)
 {
     this.siteConfig      = siteConfig;
     this.throttleService = throttleService;
     this.licenseManager  = licenseManager;
 }
Example #21
0
 internal LicenseEnforcer(ILicenseManager mgr)
 {
     this.mgr = mgr;
 }
Example #22
0
 public InternalCapabilitiesManager(ILicenseManager i_LicenseManager)
 {
     m_LicenseManager = i_LicenseManager;
 }
Example #23
0
 public StatisticsRedisHandler(RedisManager redisManager, ILicenseManager licenseManager)
 {
     redisManager.DbNo = RedisDb;
     this.redisManager = redisManager;
     instanceId        = licenseManager.InstanceId.ToString();
 }
Example #24
0
 public void FixtureSetup()
 {
     Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory);
     currentLicenseManager    = App.Current.LicenseManager;
     currentLimitationService = App.Current.LicenseLimitationsService;
 }
Example #25
0
 public LicensesController(ILicenseManager licenseManager)
 {
     LicenseManager = licenseManager;
 }
Example #26
0
 public void FixtureSetup()
 {
     currentLicenseManager    = App.Current.LicenseManager;
     currentLimitationService = App.Current.LicenseLimitationsService;
 }
 public LicenseController(ILicenseManager licenseManager)
 {
     this.licenseManager = licenseManager;
 }
 public SetupController(ISecretManager secretManager, ILicenseManager licenseManager, MPService mpService)
 {
     this.licenseManager = licenseManager;
     this.secretManager  = secretManager;
     this.mpService      = mpService;
 }
        /// <summary>
        /// Initializes a new instance of the LicensingViewModel class.
        /// </summary>
        /// <param name="messenger">The messenger object to be used for
        /// notifications.</param>
        /// <param name="workingStatusController">The object to be used for
        /// managing application working status.</param>
        /// <param name="uriNavigator">The reference to the object to be used
        /// for navigating to URI's.</param>
        /// <param name="licenseManager">The reference to the license manager
        /// object.</param>
        public LicensingViewModel(
            IMessenger messenger,
            IWorkingStatusController workingStatusController,
            IUriNavigator uriNavigator,
            ILicenseManager licenseManager)
        {
            Debug.Assert(messenger != null);
            Debug.Assert(workingStatusController != null);
            Debug.Assert(uriNavigator != null);
            Debug.Assert(licenseManager != null);

            _licenseManager           = licenseManager;
            _licenseExpirationChecker = licenseManager.LicenseExpirationChecker;
            _messenger = messenger;
            _workingStatusController = workingStatusController;
            _uriNavigator            = uriNavigator;

            _licensePageCommands = new LicensePageCommands()
            {
                CreateAccount = _CreateUrlNavigationCommand(
                    _licenseManager.LicenseComponent.CreateAccountURL,
                    _uriNavigator),
                RecoverCredentials = _CreateUrlNavigationCommand(
                    _licenseManager.LicenseComponent.RecoverCredentialsURL,
                    _uriNavigator),
                UpgradeLicense = _CreateUrlNavigationCommand(
                    _licenseManager.LicenseComponent.UpgradeLicenseURL,
                    _uriNavigator),
            };

            this.LicenseActivationStatus = _licenseManager.LicenseActivationStatus;
            this.LicenseState            = this.LicenseActivationStatus == LicenseActivationStatus.Activated ?
                                           AgsServerState.Authorized : AgsServerState.Unauthorized;
            _UpdateExpirationWarningDisplayState();

            foreach (var item in EnumHelpers.GetValues <AgsServerState>())
            {
                this.RegisterHeader(
                    item,
                    _licenseManager.LicenseComponent.LoginPrompt);
            }

            _CreateLoginState();
            _CreateConnectedState();
            _CreateNotConnectedState();

            this.LicensingNotes = _CreateLicensingNotes(
                _licenseManager.LicenseComponent.LicensingNotes);
            this.TroubleshootingNotes = _CreateTroubleshootingNotes(
                _licenseManager.LicenseComponent.TroubleshootingNotes);

            _stateFactories = new Dictionary <LicenseActivationStatus, Func <LicenseActivationViewState> >()
            {
                {
                    LicenseActivationStatus.None,
                    () => new LicenseActivationViewState
                    {
                        LoginViewState       = this.LoginState,
                        InformationViewState = (object)null,
                    }
                },
                {
                    LicenseActivationStatus.Activated,
                    () => new LicenseActivationViewState
                    {
                        LoginViewState       = this.ConnectedState,
                        InformationViewState = _CreateActivatedState(),
                    }
                },
                {
                    LicenseActivationStatus.Expired,
                    () => new LicenseActivationViewState
                    {
                        LoginViewState       = this.LoginState,
                        InformationViewState = _CreateExpiredState(),
                    }
                },
                {
                    LicenseActivationStatus.WrongCredentials,
                    () => new LicenseActivationViewState
                    {
                        LoginViewState       = this.LoginState,
                        InformationViewState = _CreateWrongCredentialsState(),
                    }
                },
                {
                    LicenseActivationStatus.NoSubscription,
                    () => new LicenseActivationViewState
                    {
                        LoginViewState       = this.LoginState,
                        InformationViewState = _CreateNoSubscriptionState(),
                    }
                },
                {
                    LicenseActivationStatus.Failed,
                    () => new LicenseActivationViewState
                    {
                        LoginViewState       = this.NotConnectedState,
                        InformationViewState = (object)null,
                    }
                },
            };
        }
Example #30
0
 public MappingFeatureManager(ILicenseManager <TBase> licenseManager, IFeatureMapper <TBase, Feature> mapper)
 {
     Licenses = licenseManager;
     Mapper   = mapper;
 }
 public void TestFixtureSetUp()
 {
     WibuInit.InitDependencies();
     currentLicenseManager = App.Current.LicenseManager;
 }
Example #32
0
        public Computation(Config c, IReadOnlyCollection <RSADecryptPublic> trustedKeys,
                           IIssueReceiver permanentIssueSink,
                           ILicenseManager mgr, ILicenseClock clock, bool enforcementEnabled) : base("Computation")
        {
            permanentIssues    = permanentIssueSink;
            EnforcementEnabled = enforcementEnabled;
            this.clock         = clock;
            Scope        = c.Plugins.LicenseScope;
            LicenseError = c.Plugins.LicenseError;
            this.mgr     = mgr;
            if (mgr.FirstHeartbeat == null)
            {
                throw new ArgumentException("ILicenseManager.Heartbeat() must be called before Computation.new");
            }

            // What features are installed on this instance?
            // For a license to be OK, it must have one of each of this nested list;
            IEnumerable <IEnumerable <string> > pluginFeaturesUsed =
                c.Plugins.GetAll <ILicensedPlugin>().Select(p => p.LicenseFeatureCodes).ToList();

            // Create or fetch all relevant license chains; ignore the empty/invalid ones, they're logged to the manager instance
            chains = c.Plugins.GetAll <ILicenseProvider>()
                     .SelectMany(p => p.GetLicenses())
                     .Select(str => mgr.GetOrAdd(str, c.Plugins.LicenseScope))
                     .Where(x => x != null && x.Licenses().Any())
                     .Concat(Scope.HasFlag(LicenseAccess.ProcessReadonly)
                          ? mgr.GetSharedLicenses()
                          : Enumerable.Empty <ILicenseChain>())
                     .Distinct()
                     .ToList();


            // Set up our domain map/normalize/search manager
            domainLookup = new DomainLookup(c, permanentIssueSink, chains);


            // Check for tampering via interfaces
            if (chains.Any(chain => chain.Licenses().Any(b => !b.Revalidate(trustedKeys))))
            {
                EverythingDenied = true;
                permanentIssueSink.AcceptIssue(new Issue(
                                                   "Licenses failed to revalidate; please contact [email protected]", IssueSeverity.Error));
            }

            // Look for grace periods
            var gracePeriods = chains.Where(IsPendingLicense).Select(GetGracePeriodFor).ToList();

            // Look for fetched and valid licenses
            var validLicenses = chains.Where(chain => !IsPendingLicense(chain))
                                .SelectMany(chain => chain.Licenses())
                                .Where(b => !b.Fields.IsRemotePlaceholder() && IsLicenseValid(b))
                                .ToList();

            // This computation expires when we cross an expires, issued date, or NetworkGracePeriod expiration
            ComputationExpires = chains.SelectMany(chain => chain.Licenses())
                                 .SelectMany(b => new[] { b.Fields.Expires, b.Fields.Issued })
                                 .Concat(gracePeriods)
                                 .Where(date => date != null)
                                 .OrderBy(d => d)
                                 .FirstOrDefault(d => d > clock.GetUtcNow());

            AllDomainsLicensed = gracePeriods.Any(t => t != null) ||
                                 validLicenses
                                 .Any(license => !license.Fields.GetAllDomains().Any() && AreFeaturesLicensed(license, pluginFeaturesUsed, false));

            KnownDomainStatus = validLicenses.SelectMany(
                b => b.Fields.GetAllDomains()
                .SelectMany(domain => b.Fields.GetFeatures()
                            .Select(
                                feature => new
                                KeyValuePair <string, string>(
                                    domain, feature))))
                                .GroupBy(pair => pair.Key, pair => pair.Value,
                                         (k, v) => new KeyValuePair <string, IEnumerable <string> >(k, v))
                                .Select(pair => new KeyValuePair <string, bool>(pair.Key,
                                                                                pluginFeaturesUsed.All(
                                                                                    set => set.Intersect(pair.Value, StringComparer.OrdinalIgnoreCase)
                                                                                    .Any())))
                                .ToDictionary(pair => pair.Key, pair => pair.Value,
                                              StringComparer.Ordinal);

            if (UpgradeNeeded())
            {
                foreach (var b in validLicenses)
                {
                    AreFeaturesLicensed(b, pluginFeaturesUsed, true);
                }
            }
        }