public GithubSharp.Core.Services.IAuthPreRequestResponse PreRequestAuth ( GithubSharp.Core.IGithubRequest githubRequest, System.Net.HttpWebRequest webRequest) { return new GithubSharp.Core.Services.AuthPreRequestResponse { Success = true, WebRequest = webRequest }; }
public GithubSharp.Core.Services.IAuthPreRequestResponse PreRequestAuth ( GithubSharp.Core.IGithubRequest githubRequest, System.Net.HttpWebRequest webRequest) { var authInfo = string.Format("{0}:{1}",Username, Password); authInfo = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(authInfo)); webRequest.Headers["Authorization"] = "Basic " + authInfo; return new GithubSharp.Core.Services.AuthPreRequestResponse { Success = true, WebRequest = webRequest }; }
public static GithubHostedRepository Convert(GithubPlugin p, GithubSharp.Core.Models.RepositoryFromSearch repo) { return new GithubHostedRepository(p) { Owner = repo.Username, Name = repo.Name, Description = repo.Description, IsAFork = repo.Fork, Forks = repo.Forks, IsPrivate = false, Homepage = string.Format("https://github.com/{0}/{1}", repo.Username, repo.Name) }; }
public static GithubHostedRepository Convert(GithubPlugin p, GithubSharp.Core.Models.Repository repo) { return new GithubHostedRepository(p) { Owner = repo.Owner, Name = repo.Name, Description = repo.Description, IsAFork = repo.Fork, Forks = repo.Forks, IsPrivate = repo.Private, Homepage = repo.Homepage }; }
public GithubIssuesViewModel(GithubSharp.Core.API.Issues issues) { _issues = issues; }
private static string GetAuthorFrom(GithubSharp.Core.Models.IssueUser issueUser) { if (issueUser == null) return null; string namePart = null; string p2 = null; if (!string.IsNullOrEmpty(issueUser.Login)) { namePart = issueUser.Login; } else if (!string.IsNullOrEmpty(issueUser.Name)) { namePart = issueUser.Name; p2 = issueUser.Email; } else if (!string.IsNullOrEmpty(issueUser.Email)) namePart = issueUser.Email; else return null; return p2 != null ? string.Format("{0} ({1})", namePart, p2) : namePart; }