Пример #1
0
        public ChangelogWindow()
        {
            InitializeComponent();

            DiscordButton.Click += Util.OpenDiscord;
            DataContext          = new ChangeLogWindowViewModel();
            try
            {
                // GitHub requires TLS 1.2, we need to hardcode this for Windows 7
                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

                using (var client = new WebClient())
                {
                    client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36");

                    dynamic releaseInfo = JsonConvert.DeserializeObject(
                        client.DownloadString("https://api.github.com/repos/goaaats/FFXIVQuickLauncher/releases/latest"));

                    ExceptionTextBox.AppendText((string)releaseInfo.body);
                }

                ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault;
            }
            catch (Exception)
            {
                ExceptionTextBox.AppendText(Loc.Localize("ReleaseInfoUnavailable", "Couldn't get release info."));
            }

            SystemSounds.Asterisk.Play();

            Activate();
            Topmost = true;
            Topmost = false;
            Focus();
        }
        public ChangelogWindow(bool prerelease)
        {
            _prerelease = prerelease;
            InitializeComponent();

            DiscordButton.Click += SupportLinks.OpenDiscord;

            var vm = new ChangeLogWindowViewModel();

            DataContext = vm;

            this.ChangeLogText.Text = vm.ChangelogLoadingLoc;

            Activate();
            Topmost = true;
            Topmost = false;
            Focus();
        }