예제 #1
0
 private static async Task <GenericModsEnabler> GetEnabler()
 {
     return(await GenericModsEnabler.GetInstanceAsync(
                AcRootDirectory.Instance.RequireValue,
                SettingsHolder.GenericMods.GetModsDirectory(),
                SettingsHolder.GenericMods.UseHardLinks));
 }
예제 #2
0
        public void Load()
        {
            var mods = SettingsHolder.GenericMods.GetModsDirectory();

            if (Directory.Exists(mods))
            {
                _enabler = GenericModsEnabler.GetInstanceAsync(AcRootDirectory.Instance.RequireValue,
                                                               mods, SettingsHolder.GenericMods.UseHardLinks).Result;
            }
        }
예제 #3
0
        public async Task LoadAsync(CancellationToken cancellationToken)
        {
            var mods = SettingsHolder.GenericMods.GetModsDirectory();

            if (Directory.Exists(mods))
            {
                _enabler = await GenericModsEnabler.GetInstanceAsync(AcRootDirectory.Instance.RequireValue,
                                                                     mods, SettingsHolder.GenericMods.UseHardLinks);
            }
        }
예제 #4
0
        protected override async Task EnableAfterInstallation(CancellationToken token)
        {
            var enabler = await GenericModsEnabler.GetInstanceAsync(
                AcRootDirectory.Instance.RequireValue,
                SettingsHolder.GenericMods.GetModsDirectory(),
                SettingsHolder.GenericMods.UseHardLinks);

            enabler.ReloadList();
            var mod = enabler.GetByName(Name);

            if (mod?.IsEnabled == false)
            {
                await enabler.EnableAsync(mod).ConfigureAwait(false);
            }
        }