private void SetTagsString()

in src/Microsoft.Azure.NotificationHubs/RegistrationDescription.cs [351:384]


        private void SetTagsString(string tagsString, bool validate)
        {
            var tags = string.IsNullOrEmpty(tagsString)
                    ? new HashSet<string>(StringComparer.OrdinalIgnoreCase)
                    : new HashSet<string>(tagsString.Split(','), StringComparer.OrdinalIgnoreCase);

            this.InvalidTags = false;

            if (validate)
            {
                this.InvalidTags = !string.IsNullOrEmpty(tagsString) && !ValidateTags(tagsString);

                if (!this.InvalidTags)
                {
                    foreach (string tag in tags)
                    {
                        if (tag.Length > Constants.MaximumTagSize)
                        {
                            this.InvalidTags = true;
                            break;
                        }
                    }
                }
            }

            if (this.InvalidTags)
            {
                Tags = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
            }
            else
            {
                Tags = tags;
            }
        }