void SetLocalizedUIElements()
 {
     pathBox.Text             = Localization.Get("ui_searchpath");
     pButtonCancel.Content    = Localization.Get("ui_cancel");
     pButtonContinue.Content  = Localization.Get("ui_continue");
     pButtonSearch.Content    = Localization.Get("ui_search");
     pButtonUninstall.Content = Localization.Get("ui_uninstall");
     iButtonBack.Content      = Localization.Get("ui_back");
     iButtonInstall.Content   = Localization.Get("ui_install");
     TextReferencer.SetText(linkLabel, Localization.Get("ui_welcometext"));
 }
        public MainWindow()
        {
            // choose language
            if (!LanguageWindow.ShowSelection())
            {
                Close();
                return;
            }

            // init main window
            InitializeComponent();

            // set title
            this.Title = string.Format("{0} {1}", Localization.Get("Name"), Version.PatcherVersion);

            // check if we can already find the steam path
            const string key   = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 40970";
            RegistryKey  myKey = Registry.LocalMachine.OpenSubKey(key, false);

            if (myKey != null && myKey.GetValue("InstallLocation") is string path && !string.IsNullOrWhiteSpace(path))
            {
                pTextBoxPath.Text = path;
            }

            // fill setup options list
            FillTreeView(Version.Changes);

            // set translated ui elements
            pathBox.Text             = Localization.Get("ui_searchpath");
            pButtonCancel.Content    = Localization.Get("ui_cancel");
            pButtonContinue.Content  = Localization.Get("ui_continue");
            pButtonSearch.Content    = Localization.Get("ui_search");
            pButtonUninstall.Content = Localization.Get("ui_uninstall");
            iButtonBack.Content      = Localization.Get("ui_back");
            iButtonInstall.Content   = Localization.Get("ui_install");
            TextReferencer.SetText(linkLabel, "ui_welcometext");

            var asm = System.Reflection.Assembly.GetExecutingAssembly();

            using (Stream stream = asm.GetManifestResourceStream("UnofficialCrusaderPatch.license.txt"))
                using (StreamReader sr = new StreamReader(stream))
                    linkLabel.Inlines.Add("\n\n\n\n\n\n" + sr.ReadToEnd());
        }