Esempio n. 1
0
        /// <summary>
        /// 本分に含まれている文字列からリンクコレクションを作成
        /// </summary>
        /// <returns></returns>
        private LinkCollection CreateLinks()
        {
            MatchCollection matches = HtmlTextUtility.LinkRegex2.Matches(body);
            LinkCollection  links   = new LinkCollection();

            foreach (Match m in matches)
            {
                string link = m.Value;

                // h抜きであれば修正
                if (HtmlTextUtility.IsShortHttpUrl.IsMatch(link))
                {
                    link = "http://" + m.Groups["url"].Value;
                }

                links.Add(link);
            }

            return(links);
        }
Esempio n. 2
0
        /// <summary>
        /// ResSetクラスのインスタンスを初期化
        /// </summary>
        /// <param name="index">レス番号</param>
        /// <param name="name">投稿者の名前</param>
        /// <param name="email">投稿者のE-mail</param>
        /// <param name="dateString">投稿日</param>
        /// <param name="body">本分</param>
        public ResSet(int index, string name,
                      string email, string dateString, string body) : this()
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (email == null)
            {
                throw new ArgumentNullException("email");
            }
            if (dateString == null)
            {
                throw new ArgumentNullException("dateString");
            }
            if (body == null)
            {
                throw new ArgumentNullException("body");
            }

            this.index              = index;
            this.name               = name;
            this.email              = email;
            this.body               = body;
            this.dateString         = dateString;
            this.host               = null;
            this.id                 = null;
            this.tag                = null;
            this.isNew              = true;
            this.abone              = false;
            this.visible            = true;
            this.bookmark           = false;
            this.serverAboned       = false;
            this.links              = null;
            this.refidx             = null;
            this.aboneTyoe          = ABoneType.NG;
            this.BackReferencedList = new List <int>();
        }