Exemplo n.º 1
0
        private void ProjectNameBox_TextChanged(object sender, EventArgs e)
        {
            var projectName = _projectNameBox.Text;
            var project = new GitHubRepository().IsValidProjectName(projectName)
                        ? new GitHubRepository(projectName)
                        : null;

            _okButton.Enabled = _testButton.Enabled = project != null;
            _linkLabel.Text = (project != null ? project.Url : GitHubRepository.HostingUrl).ToString();
        }
Exemplo n.º 2
0
 private void TestButton_Click(object sender, EventArgs e)
 {
     try
     {
         var projectName = _projectNameBox.Text;
         var url = new GitHubRepository(projectName).Url;
         using (CurrentCursorScope.EnterWait())
             new Gurtle.WebClient().DownloadData(url);
         var message = string.Format("The GitHub repository '{0}' appears valid and reachable at {1}.", projectName, url);
         MessageBox.Show(message, "Test Passed", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (WebException we)
     {
         MessageBox.Show(we.Message, "Test Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }