コード例 #1
0
        public override void HandleRequest(ILetter letter)
        {
            BayesSpamFilter bayesSpamFilter = BayesSpamFilter.GetInstance();

            if (bayesSpamFilter.BayesFilter())
            {
                letter.SetCategories(true);
                return;
            }
            else if (successor != null)
            {
                successor.HandleRequest(letter);
            }
        }
コード例 #2
0
        public override void HandleRequest(ILetter letter)
        {
            List <string> lines = File.ReadAllLines("badAddress.txt", Encoding.GetEncoding(1251)).ToList();

            foreach (string component in lines)
            {
                if (component == letter.GetSender())
                {
                    letter.SetCategories(true);
                    return;
                }
            }
            if (successor != null)
            {
                successor.HandleRequest(letter);
            }
        }
コード例 #3
0
 public abstract void HandleRequest(ILetter letter);
コード例 #4
0
 public void Remove(ILetter component)
 {
     messages.Remove(component);
 }
コード例 #5
0
 public void Add(ILetter component)
 {
     messages.Add(component);
 }