public PostFilterGroup(string i_Name, ePostPriority i_PostPriority)
 {
     Name          = i_Name;
     PostPriority  = i_PostPriority;
     r_PostFilters = new List <IPostFilter>();
     Enabled       = true;
 }
 public PostFilterGroup(string i_Name, ePostPriority i_PostPriority = ePostPriority.Hidden)
 {
     Name = i_Name;
     PostPriority = i_PostPriority;
     r_PostFilters = new List<IPostFilter>();
     Enabled = true;
 }
示例#3
0
        private ePostPriority calculatePostPriority(Post i_Post)
        {
            ePostPriority postPriority = ePostPriority.None;

            foreach (PostFilterGroup filterGroup in m_PostFilterGroups)
            {
                if (filterGroup.IsMatch(i_Post))
                {
                    postPriority = (ePostPriority)Math.Min((int)filterGroup.PostPriority, (int)postPriority);
                }

                if (postPriority == ePostPriority.Hidden)
                {
                    break;
                }
            }

            return(postPriority);
        }
        public void ReadXml(XmlReader i_Reader)
        {
            Name = i_Reader.GetAttribute("Name");
            ePostPriority postPriority;
            Enum.TryParse(i_Reader.GetAttribute("PostPriority") ?? "hidden", out postPriority);
            PostPriority = postPriority;
            i_Reader.ReadStartElement();
            i_Reader.ReadStartElement("PostFilters");
            while (i_Reader.IsStartElement())
            {
                XmlSerializer serializer = sr_Serializers[i_Reader.Name];
                r_PostFilters.Add(serializer.Deserialize(i_Reader) as IPostFilter);
                i_Reader.ReadStartElement();
            }

            i_Reader.ReadEndElement();
            i_Reader.ReadEndElement();
        }