Exemplo n.º 1
0
        private void AppReady()
        {
            Releases releases = new Releases();

            try
            {
                ri = releases.GetReleaseJSON(releaseChannel);
            }
            catch (Exception e)
            {
                MessageBox.Show("Version requested could not be found no changes have occured.", "Version Not Found");
                Console.WriteLine(String.Format("Tried to download for {0} but failed to", releaseChannel.ToString()));
                Application.Current.Shutdown(0);
            }
            string downloadUrl = ri.url;

            if (downloadUrl != null)
            {
                Progress_Text.Content = String.Format("Fetching: {0}", downloadUrl.Split(new char[] { '/' }).Last());
            }
            else
            {
                Application.Current.Shutdown(2);
            }

            Download download = new Download();

            download.downloadProgressChanged += Download_downloadProgressChanged;
            download.downloadFinished        += Download_downloadFinished;
            download.downloadFailed          += Download_downloadFailed;
            download.downloadToTemp(downloadUrl);
        }