示例#1
0
        public override bool Initialize(string url)
        {
            var match = _visualStudioTeamServicesRegex.Match(url);

            if (!match.Success)
            {
                return(false);
            }

            CompanyName = match.Groups["accountname"].Value;
            CompanyUrl  = match.Groups["companyurl"].Value;

            ProjectName = match.Groups["project"].Value;
            if (string.IsNullOrWhiteSpace(ProjectName))
            {
                ProjectName = match.Groups["repo"].Value;
            }

            // In the VSTS provider, the ProjectUrl will represent
            // the repository's name.
            ProjectUrl = match.Groups["repo"].Value;

            if (!CompanyUrl.StartsWithIgnoreCase("https://"))
            {
                CompanyUrl = String.Concat("https://", CompanyUrl);
            }

            return(true);
        }
        public override bool Initialize(string url)
        {
            var match = HostingUrlPattern.Match(url);

            if (!match.Success)
            {
                return(false);
            }

            CompanyName = match.Groups["accountname"].Value;
            CompanyUrl  = match.Groups["companyurl"].Value;

            ProjectName = match.Groups["project"].Value;
            if (string.IsNullOrWhiteSpace(ProjectName))
            {
                ProjectName = match.Groups["repo"].Value;
            }

            ProjectUrl = match.Groups["companyurl"].Value + ProjectName + "/";

            if (!CompanyUrl.StartsWithIgnoreCase("https://"))
            {
                CompanyUrl = String.Concat("https://", CompanyUrl);
            }

            if (!ProjectUrl.StartsWithIgnoreCase("https://"))
            {
                ProjectUrl = String.Concat("https://", ProjectUrl);
            }

            return(true);
        }