public GitExtLink ToGitExtLink(Match match, GitRevision revision)
        {
            GitExtLink link = new GitExtLink();

            try
            {
                var groups = new List <string>();
                for (int i = match.Groups.Count > 1 ? 1 : 0; i < match.Groups.Count; i++)
                {
                    groups.Add(match.Groups[i].Value);
                }

                link.Caption = string.Format(Caption, groups.ToArray());
                link.URI     = Format.Replace("%COMMIT_HASH%", revision.Guid);
                link.URI     = string.Format(link.URI, groups.ToArray());
                IsValid      = true;
            }
            catch (Exception e)
            {
                link.URI = e.Message + ": " + Format + " " + match.Value;
                IsValid  = false;
            }

            return(link);
        }
示例#2
0
        public GitExtLink ToGitExtLink(Match remoteMatch, Match revisionMatch, GitRevision revision)
        {
            GitExtLink link = new GitExtLink();

            var groups = new List <string>();

            AddGroupsFromMatches(remoteMatch, groups);
            AddGroupsFromMatches(revisionMatch, groups);
            string[] groupsArray = groups.ToArray();

            try
            {
                link.Caption = string.Format(Caption, groupsArray);
                link.URI     = Format.Replace("%COMMIT_HASH%", revision.Guid);
                link.URI     = string.Format(link.URI, groupsArray);
                IsValid      = true;
            }
            catch (Exception e)
            {
                link.URI = e.Message + ": " + Format + " " + groupsArray;
                IsValid  = false;
            }

            return(link);
        }
示例#3
0
        public GitExtLink ToGitExtLink(Match match, GitRevision revision)
        {
            GitExtLink link = new GitExtLink();

            try
            {
                var groups = new List<string>();
                for (int i = match.Groups.Count > 1 ? 1 : 0; i < match.Groups.Count; i++)
                {
                    groups.Add(match.Groups[i].Value);
                }

                link.Caption = string.Format(Caption, groups.ToArray());
                link.URI = Format.Replace("%COMMIT_HASH%", revision.Guid);
                link.URI = string.Format(link.URI, groups.ToArray());
                IsValid = true;
            }
            catch (Exception e)
            {
                link.URI = e.Message + ": " + Format + " " + match.Value;
                IsValid = false;
            }

            return link;
        }