예제 #1
0
        private static void Client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                try
                {
                    var j             = JArray.Parse(e.Result);
                    var latestVersion = j[0]["tag_name"].ToString();
                    var url           = j[0]["html_url"].ToString();

                    UpdateResponse?.Invoke(null, new UpdateResponseEventArgs(new Version(latestVersion), new Uri(url), e.UserState));
                }

                catch (Exception ex)
                {
                    UpdateResponse?.Invoke(null, new UpdateResponseEventArgs(ex, e.UserState));
                }
            }

            else
            {
                UpdateResponse?.Invoke(null, new UpdateResponseEventArgs(e.Error, e.UserState));
            }
        }
 //Updates the main form
 private void frmDialog_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     m_updateFunction.Invoke();
 }