public override sealed bool Equals(object obj) { if (this == obj) { return(true); } if (obj == null) { return(false); } if (GetType() != obj.GetType()) { return(false); } Url url = (Url)obj; if (OriginUrl.Equals(url.OriginUrl)) { return(true); } else { return(false); } }
public override int GetHashCode() { const int prime = 31; int result = 1; result = prime * result + (ReferenceEquals(OriginUrl, null) ? 0 : OriginUrl.GetHashCode()); return(result); }
public override int GetHashCode() { unchecked { int hashCode = Id; hashCode = (hashCode * 397) ^ (OriginUrl != null ? OriginUrl.GetHashCode() : 0); hashCode = (hashCode * 397) ^ ExpireInDays.GetHashCode(); hashCode = (hashCode * 397) ^ ExpireMode.GetHashCode(); hashCode = (hashCode * 397) ^ CreatedOn.GetHashCode(); return(hashCode); } }
private string ConvertUrl() { if (!OriginUrl.Contains("github.com")) { throw new ArgumentException("OriginUrl must be for github.com", "OriginUrl"); } var prefix = OriginUrl.StartsWith("[email protected]:") ? "[email protected]:" : "https://github.com/"; var repoName = OriginUrl.Replace(prefix, ""); repoName = repoName.Replace(".git", ""); return($"https://raw.githubusercontent.com/{repoName}/{Commit}/*"); }
public AppSettings(HttpRequestBase request) { OriginUrl = request.Url.GetLeftPart(UriPartial.Authority); if (!OriginUrl.EndsWith("/")) { OriginUrl += "/"; } RootUrl = request.Url.GetLeftPart(UriPartial.Authority) + request.ApplicationPath; if (!RootUrl.EndsWith("/")) { RootUrl += "/"; } var version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); Version = version.Substring(0, version.LastIndexOf('.')); }