Esempio n. 1
0
        private static async Task InitProgramAsync(OptionsBase options)
        {
            var restartArgs = new List <string>(3);

            if (options.Verbose)
            {
                restartArgs.Add("--verbose");
            }
            if (options.NoLog)
            {
                restartArgs.Add("--no-log");
            }
            if (!string.IsNullOrWhiteSpace(options.AppDataPath))
            {
                restartArgs.Add($"--app-data=\"{options.AppDataPath}\"");
            }
            RestartArgs = string.Join(" ", restartArgs);

            var factory = new GlobalSingletonFactory(ApplicationDirectory, ApplicationDataDirectory);

            Settings = factory.LoadSettings();
            (Manager, Locations, ModStateManager) = await factory.CreateManagerAsync(Settings);

            Locations.ModsReloaded += async(s, e) =>
            {
                _modpacks = await LoadModpacksAsync();
            };
            _modpacks = await LoadModpacksAsync();
        }
Esempio n. 2
0
        private static async Task InitProgramAsync()
        {
            var factory = new GlobalSingletonFactory(ApplicationDirectory, ApplicationDataDirectory);

            Settings = await factory.LoadSettingsAsync();

            (Manager, Locations) = await factory.CreateManagerAsync(Settings);

            Locations.ModsReloaded += async(s, e) =>
            {
                _modpacks = await LoadModpacksAsync();
            };
            _modpacks = await LoadModpacksAsync();
        }