コード例 #1
0
ファイル: Setup.cs プロジェクト: DeaTh-G/Reloaded-II
        /// <summary>
        /// Sets up services which can be used by the various viewmodels.
        /// </summary>
        private static void SetupServices()
        {
            var config = IoC.Get <LoaderConfig>();
            SynchronizationContext synchronizationContext = null;

            ActionWrappers.ExecuteWithApplicationDispatcher(() => synchronizationContext = SynchronizationContext.Current);

            IoC.Kernel.Rebind <IProcessWatcher>().ToConstant(IProcessWatcher.Get());
            IoC.Kernel.Rebind <ApplicationConfigService>().ToConstant(new ApplicationConfigService(config, synchronizationContext));
            IoC.Kernel.Rebind <ModConfigService>().ToConstant(new ModConfigService(config, synchronizationContext));
        }
コード例 #2
0
    /// <summary>
    /// Sets up services which can be used by the various viewmodels.
    /// </summary>
    private static void SetupServices()
    {
        var config = IoC.Get <LoaderConfig>();
        var synchronizationContext = Actions.SynchronizationContext;

        IoC.BindToConstant(IProcessWatcher.Get());
        IoC.BindToConstant(new ApplicationConfigService(config, synchronizationContext));

        var modConfigService = new ModConfigService(config, synchronizationContext);

        IoC.BindToConstant(modConfigService);
        IoC.BindToConstant(new ModUserConfigService(config, modConfigService, synchronizationContext));
    }