예제 #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);
        }
예제 #3
0
        public override bool Initialize(string url)
        {
            var match = _gitHubRegex.Match(url);

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

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

            ProjectName = match.Groups["project"].Value;
            ProjectUrl  = match.Groups["url"].Value;

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

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

            return(true);
        }
예제 #4
0
        public List <IUrl> GetNext()
        {
            var urlList = new List <IUrl>();

            if (_companyDict.Count > 0)
            {
                foreach (var item in _companyDict)
                {
                    string companyName = item.CompanyName;

                    if (_companyAlias.ContainsKey(companyName))
                    {
                        companyName = _companyAlias[companyName];
                    }

                    if (!string.IsNullOrEmpty(companyName))
                    {
                        CompanyUrl monographUrl = new CompanyUrl
                        {
                            CountryName = _country,
                            CompanyName = companyName
                        };
                        urlList.Add(monographUrl);
                    }
                }

                return(urlList);
            }
            return(null);
        }
예제 #5
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // Overflow is fine, just wrap
            unchecked
            {
                var hashCode = 41;

                // Suitable nullity checks etc, of course :)
#pragma warning disable CA1307 // Specify StringComparison

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (FirstName != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + FirstName.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (LastName != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + LastName.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (CompanyName != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + CompanyName.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (CompanyUrl != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + CompanyUrl.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (Description != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + Description.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (BlogsUrl != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + BlogsUrl.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (ContactsUrl != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + ContactsUrl.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (TwitterUrl != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + TwitterUrl.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (HabrUrl != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + HabrUrl.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (GitHubUrl != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + GitHubUrl.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (MeetupIds != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + MeetupIds.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (TalkIds != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + TalkIds.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (VenueIds != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + VenueIds.GetHashCode();
                }
#pragma warning restore CA1307 // Specify StringComparison
                return(hashCode);
            }
        }
예제 #6
0
        /// <inheritdoc />
        /// <summary>
        /// Returns true if UpdateSpeakerDraftParameters instances are equal
        /// </summary>
        /// <param name="other">Instance of UpdateSpeakerDraftParameters to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(UpdateSpeakerDraftParameters other)
        {
#pragma warning disable IDE0041 // Use 'is null' check
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

#pragma warning disable CA1309                  // Use ordinal stringcomparison
#pragma warning disable CA1307                  // Specify StringComparison
#pragma warning disable SA1515                  // Single-line comment must be preceded by blank line
#pragma warning disable SA1009                  // Closing parenthesis must be spaced correctly
            return
                (#pragma warning disable SA1119 // Statement must not use unnecessary parenthesis
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(FirstName, other.FirstName) ||
                     (FirstName != null && FirstName.Equals(other.FirstName))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(LastName, other.LastName) ||
                     (LastName != null && LastName.Equals(other.LastName))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(CompanyName, other.CompanyName) ||
                     (CompanyName != null && CompanyName.Equals(other.CompanyName))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(CompanyUrl, other.CompanyUrl) ||
                     (CompanyUrl != null && CompanyUrl.Equals(other.CompanyUrl))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(Description, other.Description) ||
                     (Description != null && Description.Equals(other.Description))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(BlogsUrl, other.BlogsUrl) ||
                     (BlogsUrl != null && BlogsUrl.Equals(other.BlogsUrl))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(ContactsUrl, other.ContactsUrl) ||
                     (ContactsUrl != null && ContactsUrl.Equals(other.ContactsUrl))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(TwitterUrl, other.TwitterUrl) ||
                     (TwitterUrl != null && TwitterUrl.Equals(other.TwitterUrl))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(HabrUrl, other.HabrUrl) ||
                     (HabrUrl != null && HabrUrl.Equals(other.HabrUrl))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(GitHubUrl, other.GitHubUrl) ||
                     (GitHubUrl != null && GitHubUrl.Equals(other.GitHubUrl))
                 ) &&
                 (
                     MeetupIds == other.MeetupIds ||
                     (MeetupIds != null && MeetupIds.SequenceEqual(other.MeetupIds))
                 ) &&
                 (
                     TalkIds == other.TalkIds ||
                     (TalkIds != null && TalkIds.SequenceEqual(other.TalkIds))
                 ) &&
                 (
                     VenueIds == other.VenueIds ||
                     (VenueIds != null && VenueIds.SequenceEqual(other.VenueIds))
                 ));

#pragma warning restore SA1119 // Statement must not use unnecessary parenthesis
#pragma warning restore SA1009 // Closing parenthesis must be spaced correctly
#pragma warning restore SA1515 // Single-line comment must be preceded by blank line
#pragma warning restore CA1307 // Specify StringComparison
#pragma warning restore CA1309 // Use ordinal stringcomparison
        }