コード例 #1
0
 public FormModDownload(IConfiguration configuration)
 {
     InitializeComponent();
     _configuration         = configuration;
     _auroraVersionRegistry = new AuroraVersionRegistry(configuration);
     _modRegistry           = new ModRegistry(configuration);
 }
コード例 #2
0
 public FormMain(IConfiguration configuration, AuroraVersionRegistry auroraVersionRegistry, ModRegistry modRegistry)
 {
     InitializeComponent();
     _configuration         = configuration;
     _auroraVersionRegistry = auroraVersionRegistry;
     _modRegistry           = modRegistry;
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: 01010100b/AuroraLoader
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Log.Clear();
            Log.Debug("Start logging");

            if (!File.Exists(Path.Combine(AuroraLoaderExecutableDirectory, "aurora.exe")))
            {
                Log.Debug("Aurora not installed");
                var dialog = MessageBox.Show("Aurora not installed. Download and install? This might take a while.", "Install Aurora", MessageBoxButtons.YesNo);
                if (dialog == DialogResult.Yes)
                {
                    InstallAurora();
                }
                else
                {
                    Application.Exit();
                    return;
                }
            }

            // TODO would love to set up dependency injection
            var configuration = new ConfigurationBuilder()
                                .SetBasePath(Directory.GetCurrentDirectory())
                                .AddJsonFile(path: "appsettings.json", optional: true, reloadOnChange: true)
                                .Build();

            var mirrorRegistry        = new MirrorRegistry(configuration);
            var auroraVersionRegistry = new AuroraVersionRegistry(configuration, mirrorRegistry);
            var localRegistry         = new LocalModRegistry(configuration);
            var remoteRegistry        = new RemoteModRegistry(configuration, mirrorRegistry);
            var modRegistry           = new ModRegistry(configuration, localRegistry, remoteRegistry);

            modRegistry.Update();
            Application.Run(new FormMain(configuration, auroraVersionRegistry, modRegistry));
        }