Ejemplo n.º 1
0
        public Func <Post, bool> ToFunc()
        {
            var s = IsFilterSafe;
            var q = IsFilterQuestionable;
            var e = IsFilterExplicit;

            var h = IsFilterHorizontal;
            var v = IsFilterVertical;

            var a = IsFilterAllowHidden;
            var b = IsFilterAllowHeld;

            var tbl = TagBlacklist.Split(' ').ToList();

            return(o => ((o.Rating == "s" && s) || (o.Rating == "q" && q) || (o.Rating == "e" && e))
                   &&
                   ((o.Width >= o.Height && h) || (o.Width < o.Height && v))
                   &&
                   ((o.IsShownInIndex || a))
                   &&
                   ((b || !o.IsHeld))
                   &&
                   (o.Tags.Split(' ').ToList().FirstOrDefault(tag => tbl.FirstOrDefault(t => String.Compare(t, tag, true) == 0) != default(string)) == default(string))
                   );
        }
Ejemplo n.º 2
0
        public bool ShouldSkip(DataTable dt, DicomTag tag)
        {
            //if there is a whitelist
            if (TagWhitelist != null)
            {
                if (!TagWhitelist.IsMatch(tag.DictionaryEntry.Keyword)) //and the current header isn't matched by it
                {
                    return(true);
                }
            }

            //if there is a blacklist
            if (TagBlacklist != null)
            {
                if (TagBlacklist.IsMatch(tag.DictionaryEntry.Keyword)) //and the current header matches the blacklist
                {
                    return(true);                                      //skip it
                }
            }
            //if there is an explict mapping to follow
            if (FieldMapTableIfAny != null || UseAllTableInfoInLoadAsFieldMap != null)
            {
                //if we don't have the tag in our schema ignore it
                if (!dt.Columns.Contains(tag.DictionaryEntry.Keyword))
                {
                    return(true);
                }
            }

            return(false);
        }