예제 #1
0
        /// <summary>
        /// Creates a link from the given TagElement.
        /// </summary>
        /// <param name="tag">TagElement</param>
        /// <returns>The generated link</returns>
        private string CreateHyperlink(TagElement tag)
        {
            string hyperlink;

            if (string.IsNullOrEmpty(SearchPath))
            {
                hyperlink = string.Format("<a href=?Action=SearchTag&amp;TagFilter={1}>{0}</a>", tag.Name, HttpUtility.UrlEncode(tag.Name));
            }
            else
            {
                hyperlink = string.Format("<a href={0}?TagFilter={1}>{1}</a>", SearchPath, HttpUtility.UrlEncode(tag.Name));
            }

            return(hyperlink);
        }
예제 #2
0
        /// <summary>
        /// Initializes the TagElement list from the given string array
        /// </summary>
        /// <param name="tagsList">Array of parsed tags (words)</param>
        private void SetTagList(string[] tagsList)
        {
            for (int i = 0; i < tagsList.Length; i++)
            {
                tagsList[i] = tagsList[i].Trim(_notAllowedChars);

                if (!string.IsNullOrEmpty(tagsList[i]))
                {
                    var newTagElement = new TagElement(tagsList[i], _searchPath);

                    if (!_bannedTagsList.Contains(tagsList[i]) && !_taglist.Contains(newTagElement))
                    {
                        _taglist.Add(newTagElement);
                    }
                }
            }
        }