示例#1
0
        private void OnStartup(object sender, StartupEventArgs e)
        {
            // Ideally this should be in Setup, however the download dialogs should be localized.
            var launcherFolder = Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]);

            Selector = new XamlFileSelector($"{launcherFolder}\\Languages");
            Resources.MergedDictionaries.Add(Selector);

            /* Check if Download Mod */
            if (_commandLineArguments.TryGetValue(Constants.ParameterDownload, out string downloadUrl))
            {
                if (downloadUrl.StartsWith($"{Constants.ReloadedProtocol}:", StringComparison.InvariantCultureIgnoreCase))
                {
                    downloadUrl = downloadUrl.Substring(Constants.ReloadedProtocol.Length + 1);
                }

                var dialog = new DownloadModArchiveDialog(new[] { new Uri(downloadUrl) });
                dialog.ShowDialog();

                // Quit the process.
                Environment.Exit(0);
            }

            _commandLineArguments = null;
            this.Startup         -= OnStartup;
        }
示例#2
0
        private void SetupResources()
        {
            // Ideally this should be in Setup, however the download dialogs should be localized.
            var launcherFolder = Path.GetDirectoryName(GetCommandLineArgs()[0]);

            LanguageSelector = new XamlFileSelector($"{launcherFolder}\\Assets\\Languages");
            ThemeSelector    = new XamlFileSelector($"{launcherFolder}\\Theme");
            Resources.MergedDictionaries.Add(LanguageSelector);
            Resources.MergedDictionaries.Add(ThemeSelector);
        }