Exemplo n.º 1
0
        /// <summary>
        /// 指定した要素を文字列に変換
        /// </summary>
        /// <param name="element"></param>
        /// <returns></returns>
        public string ToString(ResSetElement element)
        {
            string obj = String.Empty;

            switch (element)
            {
            case ResSetElement.Name:
                obj = Name;
                break;

            case ResSetElement.Email:
                obj = Email;
                break;

            case ResSetElement.Body:
                obj = Body;
                break;

            case ResSetElement.ID:
                obj = ID;
                break;

            case ResSetElement.DateString:
                obj = DateString;
                break;

            case ResSetElement.All:
                obj = Name + " " + Email + " " + DateString + " " + Body;
                break;
            }
            return(obj);
        }
Exemplo n.º 2
0
 public bool IsMatch(ResSet res, out ResSetElement matchedElement, out string matchWord)
 {
     if (body.IsMatch(res.Body, out matchWord))
     {
         matchedElement = ResSetElement.Body;
         return(true);
     }
     else if (name.IsMatch(res.Name, out matchWord))
     {
         matchedElement = ResSetElement.Name;
         return(true);
     }
     else if (email.IsMatch(res.Email, out matchWord))
     {
         matchedElement = ResSetElement.Email;
         return(true);
     }
     else if (id.IsMatch(res.ID, out matchWord))
     {
         matchedElement = ResSetElement.ID;
         return(true);
     }
     else
     {
         matchedElement = ResSetElement.Unknown;
         return(false);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// textがNGワードに一致するかどうかを判断
 /// </summary>
 /// <param name="text"></param>
 /// <returns></returns>
 public bool IsMatch(string text, out ResSetElement matchedElement)
 {
     if (body.IsMatch(text))
     {
         matchedElement = ResSetElement.Body;
         return(true);
     }
     else if (name.IsMatch(text))
     {
         matchedElement = ResSetElement.Name;
         return(true);
     }
     else if (email.IsMatch(text))
     {
         matchedElement = ResSetElement.Email;
         return(true);
     }
     else if (id.IsMatch(text))
     {
         matchedElement = ResSetElement.ID;
         return(true);
     }
     else
     {
         matchedElement = ResSetElement.Unknown;
         return(false);
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// 指定したレスに一致するかどうかを判断
        /// </summary>
        /// <param name="res"></param>
        /// <returns></returns>
        public bool IsMatch(ResSet res, out ResSetElement matchedElement)
        {
            string matchWord;

            return(IsMatch(res, out matchedElement, out matchWord));
        }
Exemplo n.º 5
0
 /// <summary>
 /// 指定したキーワードを含むレスを抽出し表示
 /// </summary>
 /// <param name="keyword">検索キーワード</param>
 /// <param name="element">検索対象の要素</param>
 public abstract bool InnerExtract(string keyword, ResSetElement element);
Exemplo n.º 6
0
 /// <summary>
 /// 指定したキーワードを含むレスを抽出
 /// </summary>
 /// <param name="keyword">検索キーワード</param>
 /// <param name="element">検索対象の要素</param>
 /// <returns></returns>
 public abstract ResSetCollection Extract(string keyword, ResSetElement element);