コード例 #1
0
        public ManageModsViewModel(ApplicationConfigService appConfigService, ModConfigService modConfigService)
        {
            ModConfigService    = modConfigService;
            _appConfigService   = appConfigService;
            _setModImageCommand = new SetModImageCommand(this);

            SelectedModTuple = ModConfigService.Mods.FirstOrDefault();
        }
コード例 #2
0
 public EditAppViewModel(ApplicationConfigService appConfigService, ApplicationViewModel model)
 {
     Application                = model.ApplicationTuple;
     AppConfigService           = appConfigService;
     DeleteApplicationCommand   = new DeleteApplicationCommand(this);
     DeployAsiLoaderCommand     = new DeployAsiLoaderCommand(this);
     SetApplicationImageCommand = new SetApplicationImageCommand(this);
 }
コード例 #3
0
        public void Configuration(IAppBuilder app)
        {
            ApplicationConfigService appConfiguration = new ApplicationConfigService();

            // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=316888
            app.UseAutofacMiddleware(Bootstrapper.Run(appConfiguration));
            app.UseAutofacMvc();
        }
コード例 #4
0
    /// <inheritdoc />
    public ManageModsViewModel(ApplicationConfigService appConfigService, ModConfigService modConfigService)
    {
        ModConfigService  = modConfigService;
        _appConfigService = appConfigService;

        SelectedModTuple = ModConfigService.Items.FirstOrDefault() !;
        CloneCurrentItem();
        PropertyChanged += OnSelectedModChanged;
        UpdateCommands();
    }
コード例 #5
0
    /// <inheritdoc />
    public EditAppViewModel(ApplicationConfigService appConfigService, ApplicationViewModel model)
    {
        Application              = model.ApplicationTuple;
        AppConfigService         = appConfigService;
        DeleteApplicationCommand = new CallbackCommand(new DeleteApplicationCommand(Application), AfterDeleteApplication);
        PropertyChanged         += OnApplicationChanged;

        // Build Package Provider Configurations
        foreach (var provider in PackageProviderFactory.All)
        {
            var result = ProviderFactoryConfiguration.TryCreate(provider, Application);
            if (result != null)
            {
                PackageProviders.Add(result);
            }
        }

        RefreshCommands();
    }
コード例 #6
0
    /// <summary/>
    public SettingsPageViewModel(ApplicationConfigService appConfigService, ModConfigService modConfigService, LoaderConfig loaderConfig)
    {
        AppConfigService = appConfigService;
        ModConfigService = modConfigService;
        LoaderConfig     = loaderConfig;

        UpdateTotalApplicationsInstalled();
        UpdateTotalModsInstalled();
        AppConfigService.Items.CollectionChanged += MainPageViewModelOnApplicationsChanged;
        ModConfigService.Items.CollectionChanged += ManageModsViewModelOnModsChanged;

        var version = FileVersionInfo.GetVersionInfo(Process.GetCurrentProcess().MainModule !.FileName !);

        Copyright      = Regex.Replace(version.LegalCopyright !, @"\|.*", $"| {Version.GetReleaseVersion()!.ToNormalizedString()}");
        RuntimeVersion = $"Core: {RuntimeInformation.FrameworkDescription}";
        ActionWrappers.ExecuteWithApplicationDispatcher(() =>
        {
            SelectCurrentLanguage();
            SelectCurrentTheme();
        });
    }
コード例 #7
0
        public SettingsPageViewModel(ApplicationConfigService appConfigService, ModConfigService modConfigService, LoaderConfig loaderConfig)
        {
            AppConfigService = appConfigService;
            ModConfigService = modConfigService;
            LoaderConfig     = loaderConfig;

            UpdateTotalApplicationsInstalled();
            UpdateTotalModsInstalled();
            AppConfigService.Applications.CollectionChanged += MainPageViewModelOnApplicationsChanged;
            ModConfigService.Mods.CollectionChanged         += ManageModsViewModelOnModsChanged;

            var version = FileVersionInfo.GetVersionInfo(Process.GetCurrentProcess().MainModule.FileName);

            Copyright      = version.LegalCopyright;
            RuntimeVersion = $"Core: {System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription}";
            ActionWrappers.ExecuteWithApplicationDispatcher(() =>
            {
                SelectCurrentLanguage();
                SelectCurrentTheme();
            });
        }
コード例 #8
0
    /// <inheritdoc />
    public EditModDialogViewModel(PathTuple <ModConfig> modTuple, ApplicationConfigService applicationConfigService, ModConfigService modConfigService)
    {
        _applicationConfigService = applicationConfigService;
        ConfigTuple = modTuple;
        Config      = modTuple.Config;

        // Build Dependencies
        var mods = modConfigService.Items; // In case collection changes during window open.

        foreach (var mod in mods)
        {
            bool isEnabled = modTuple.Config.ModDependencies.Contains(mod.Config.ModId, StringComparer.OrdinalIgnoreCase);
            Dependencies.Add(new BooleanGenericTuple <IModConfig>(isEnabled, mod.Config));
        }

        // Build Applications
        var apps = applicationConfigService.Items;

        foreach (var app in apps)
        {
            bool isEnabled = modTuple.Config.SupportedAppId.Contains(app.Config.AppId, StringComparer.OrdinalIgnoreCase);
            Applications.Add(new BooleanGenericTuple <IApplicationConfig>(isEnabled, app.Config));
        }

        // Build Update Configurations
        foreach (var resolver in PackageResolverFactory.All)
        {
            var result = ResolverFactoryConfiguration.TryCreate(resolver, ConfigTuple);
            if (result != null)
            {
                Updates.Add(result);
            }
        }

        // Everything Else
        _setModImageCommand = new SetModImageCommand(modTuple);
        IoC.RebindToConstant(this);
        PropertyChanged += OnPageChanged;
    }
コード例 #9
0
        public static IContainer Run(ApplicationConfigService configService)
        {
            var builder = new ContainerBuilder();

            builder.RegisterInstance(configService).As <IVersionInfo>().SingleInstance();
            builder.RegisterInstance(configService).As <IConfigInfo>().SingleInstance();
            builder.RegisterInstance(configService).As <IServerInfo>().SingleInstance();

            builder.RegisterGeneric(typeof(DomainMapper <>)).As(typeof(IDomainMapper <>)).InstancePerDependency();
            builder.RegisterType <CsvParser>().AsImplementedInterfaces().InstancePerDependency();

            builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly())
            .AsImplementedInterfaces();

            builder.RegisterControllers(Assembly.GetExecutingAssembly());

            // Set the WebApi dependency resolver.
            var container = builder.Build();

            DependencyResolver.SetResolver(new AutofacDependencyResolver(container));

            return(container);
        }
コード例 #10
0
 /// <summary/>
 /// <param name="viewModel">Viewmodel of the main page. Used to immediately move launcher to new page. Can be null.</param>
 /// <param name="configService">Provides access to application configurations.</param>
 public AddApplicationCommand(MainPageViewModel?viewModel, ApplicationConfigService configService)
 {
     _mainPageViewModel = viewModel;
     _configService     = configService;
 }
コード例 #11
0
    /* Construction */

    /// <summary/>
    public AutoInjector(ApplicationConfigService configService)
    {
        _configService  = configService;
        _processWatcher = IoC.GetConstant <IProcessWatcher>();
        _processWatcher.OnNewProcess += ProcessWatcherOnOnNewProcess;
    }
        /// <summary>
        /// Initializes a new instance of the <see cref="HomeController" /> class.
        /// </summary>
        /// <param name="logger">The logger.</param>
        /// <param name="apiClient">The API Client<see cref="IFulfilmentApiClient" />.</param>
        /// <param name="subscriptionRepo">The subscription repository.</param>
        /// <param name="planRepository">The plan repository.</param>
        /// <param name="userRepository">The user repository.</param>
        /// <param name="applicationLogRepository">The application log repository.</param>
        /// <param name="subscriptionLogsRepo">The subscription logs repository.</param>
        /// <param name="applicationConfigRepository">The application configuration repository.</param>
        /// <param name="emailTemplateRepository">The email template repository.</param>
        /// <param name="offersRepository">The offers repository.</param>
        /// <param name="planEventsMappingRepository">The plan events mapping repository.</param>
        /// <param name="offerAttributesRepository">The offer attributes repository.</param>
        /// <param name="eventsRepository">The events repository.</param>
        /// <param name="cloudConfigs">The cloud configs.</param>
        /// <param name="loggerFactory">The logger factory.</param>
        /// <param name="emailService">The email service.</param>
        public HomeController(ILogger <HomeController> logger, IFulfillmentApiService apiService, ISubscriptionsRepository subscriptionRepo, IPlansRepository planRepository, IUsersRepository userRepository, IApplicationLogRepository applicationLogRepository, ISubscriptionLogRepository subscriptionLogsRepo, IApplicationConfigRepository applicationConfigRepository, IEmailTemplateRepository emailTemplateRepository, IOffersRepository offersRepository, IPlanEventsMappingRepository planEventsMappingRepository, IOfferAttributesRepository offerAttributesRepository, IEventsRepository eventsRepository, ILoggerFactory loggerFactory, IEmailService emailService)
        {
            this.apiService                  = apiService;
            this.subscriptionRepository      = subscriptionRepo;
            this.subscriptionLogRepository   = subscriptionLogsRepo;
            this.applicationLogRepository    = applicationLogRepository;
            this.planRepository              = planRepository;
            this.userRepository              = userRepository;
            this.userService                 = new UserService(this.userRepository);
            this.subscriptionService         = new SubscriptionService(this.subscriptionRepository, this.planRepository);
            this.applicationLogService       = new ApplicationLogService(this.applicationLogRepository);
            this.applicationConfigRepository = applicationConfigRepository;
            this.applicationConfigService    = new ApplicationConfigService(this.applicationConfigRepository);
            this.emailTemplateRepository     = emailTemplateRepository;
            this.planEventsMappingRepository = planEventsMappingRepository;
            this.offerAttributesRepository   = offerAttributesRepository;
            this.logger           = logger;
            this.offersRepository = offersRepository;
            this.planService      = new PlanService(this.planRepository, this.offerAttributesRepository, this.offersRepository);
            this.eventsRepository = eventsRepository;
            this.emailService     = emailService;
            this.loggerFactory    = loggerFactory;

            this.pendingActivationStatusHandlers = new PendingActivationStatusHandler(
                apiService,
                subscriptionRepo,
                subscriptionLogsRepo,
                planRepository,
                userRepository,
                loggerFactory.CreateLogger <PendingActivationStatusHandler>());

            this.pendingFulfillmentStatusHandlers = new PendingFulfillmentStatusHandler(
                apiService,
                applicationConfigRepository,
                subscriptionRepo,
                subscriptionLogsRepo,
                planRepository,
                userRepository,
                this.loggerFactory.CreateLogger <PendingFulfillmentStatusHandler>());

            this.notificationStatusHandlers = new NotificationStatusHandler(
                apiService,
                planRepository,
                applicationConfigRepository,
                emailTemplateRepository,
                planEventsMappingRepository,
                offerAttributesRepository,
                eventsRepository,
                subscriptionRepo,
                userRepository,
                offersRepository,
                emailService,
                this.loggerFactory.CreateLogger <NotificationStatusHandler>());

            this.unsubscribeStatusHandlers = new UnsubscribeStatusHandler(
                apiService,
                subscriptionRepo,
                subscriptionLogsRepo,
                planRepository,
                userRepository,
                this.loggerFactory.CreateLogger <UnsubscribeStatusHandler>());
        }
 public ApplicationConfigController(IApplicationConfigRepository applicationConfigRepository, ILogger <ApplicationConfigController> logger)
 {
     this.appConfigRepository = applicationConfigRepository;
     this.logger      = logger;
     appConfigService = new ApplicationConfigService(this.appConfigRepository);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="HomeController" /> class.
        /// </summary>
        /// <param name="usersRepository">The users repository.</param>
        /// <param name="billingApiService">The billing API service.</param>
        /// <param name="logger">The logger.</param>
        /// <param name="subscriptionRepo">The subscription repo.</param>
        /// <param name="planRepository">The plan repository.</param>
        /// <param name="subscriptionUsageLogsRepository">The subscription usage logs repository.</param>
        /// <param name="dimensionsRepository">The dimensions repository.</param>
        /// <param name="subscriptionLogsRepo">The subscription logs repo.</param>
        /// <param name="applicationConfigRepository">The application configuration repository.</param>
        /// <param name="userRepository">The user repository.</param>
        /// <param name="fulfillApiService">The fulfill API client.</param>
        /// <param name="applicationLogRepository">The application log repository.</param>
        /// <param name="emailTemplateRepository">The email template repository.</param>
        /// <param name="planEventsMappingRepository">The plan events mapping repository.</param>
        /// <param name="eventsRepository">The events repository.</param>
        /// <param name="options">The options.</param>
        /// <param name="cloudConfigs">The cloud configs.</param>
        /// <param name="loggerFactory">The logger factory.</param>
        /// <param name="emailService">The email service.</param>
        /// <param name="offersRepository">The offers repository.</param>
        /// <param name="offersAttributeRepository">The offers attribute repository.</param>
        public HomeController(
            IUsersRepository usersRepository, IMeteredBillingApiService billingApiService, ILogger <HomeController> logger, ISubscriptionsRepository subscriptionRepo, IPlansRepository planRepository, ISubscriptionUsageLogsRepository subscriptionUsageLogsRepository, IMeteredDimensionsRepository dimensionsRepository, ISubscriptionLogRepository subscriptionLogsRepo, IApplicationConfigRepository applicationConfigRepository, IUsersRepository userRepository, IFulfillmentApiService fulfillApiService, IApplicationLogRepository applicationLogRepository, IEmailTemplateRepository emailTemplateRepository, IPlanEventsMappingRepository planEventsMappingRepository, IEventsRepository eventsRepository, IOptions <SaaSApiClientConfiguration> options, ILoggerFactory loggerFactory, IEmailService emailService, IOffersRepository offersRepository, IOfferAttributesRepository offersAttributeRepository)
        {
            this.billingApiService               = billingApiService;
            this.subscriptionRepo                = subscriptionRepo;
            this.subscriptionLogRepository       = subscriptionLogsRepo;
            this.planRepository                  = planRepository;
            this.subscriptionUsageLogsRepository = subscriptionUsageLogsRepository;
            this.dimensionsRepository            = dimensionsRepository;
            this.logger = logger;
            this.applicationConfigRepository = applicationConfigRepository;
            this.applicationConfigService    = new ApplicationConfigService(this.applicationConfigRepository);
            this.userRepository              = userRepository;
            this.userService                 = new UserService(userRepository);
            this.fulfillApiService           = fulfillApiService;
            this.applicationLogRepository    = applicationLogRepository;
            this.applicationLogService       = new ApplicationLogService(this.applicationLogRepository);
            this.subscriptionRepository      = this.subscriptionRepo;
            this.subscriptionService         = new SubscriptionService(this.subscriptionRepository, this.planRepository);
            this.emailTemplateRepository     = emailTemplateRepository;
            this.planEventsMappingRepository = planEventsMappingRepository;
            this.eventsRepository            = eventsRepository;
            this.emailService                = emailService;
            this.offersRepository            = offersRepository;
            this.offersAttributeRepository   = offersAttributeRepository;
            this.loggerFactory               = loggerFactory;

            this.pendingActivationStatusHandlers = new PendingActivationStatusHandler(
                fulfillApiService,
                subscriptionRepo,
                subscriptionLogsRepo,
                planRepository,
                userRepository,
                loggerFactory.CreateLogger <PendingActivationStatusHandler>());

            this.pendingFulfillmentStatusHandlers = new PendingFulfillmentStatusHandler(
                fulfillApiService,
                applicationConfigRepository,
                subscriptionRepo,
                subscriptionLogsRepo,
                planRepository,
                userRepository,
                this.loggerFactory.CreateLogger <PendingFulfillmentStatusHandler>());

            this.notificationStatusHandlers = new NotificationStatusHandler(
                fulfillApiService,
                planRepository,
                applicationConfigRepository,
                emailTemplateRepository,
                planEventsMappingRepository,
                offersAttributeRepository,
                eventsRepository,
                subscriptionRepo,
                userRepository,
                offersRepository,
                emailService,
                this.loggerFactory.CreateLogger <NotificationStatusHandler>());

            this.unsubscribeStatusHandlers = new UnsubscribeStatusHandler(
                fulfillApiService,
                subscriptionRepo,
                subscriptionLogsRepo,
                planRepository,
                userRepository,
                this.loggerFactory.CreateLogger <UnsubscribeStatusHandler>());
        }