Пример #1
0
        public void CreateMetadataFiler(int sectionNumber, string filterString, MootaDootaDefinishin md)
        {
            DynamikKodeFaktory factory = new DynamikKodeFaktory();

            List <IFilter> metadataFilters = new List <IFilter>();

            if (sectionNumber == 0)
            {
                metadataFilters.Add(KwoteModelFilterInfo.Create(md));
            }
            else if (sectionNumber == 1)
            {
                metadataFilters.Add(KwestionaireModelFilterInfo.Create(md));
            }
            else
            {
                metadataFilters.Add(DefaultFilterStuff.Create(md));
            }

            IEnumerable <IFilter> dynamikFilters = filterString.Split(';')
                                                   .Select(fs => factory.Create(fs, new[]
            {
                typeof(KwoteModel),
                typeof(KweschunareModel),
            },
                                                                                new[]
            {
                typeof(KwoteModel).Namespace,
                typeof(KweschunareModel).Namespace
            }));

            metadataFilters.AddRange(dynamikFilters);
        }
        public static IFilter Create(MootaDootaDefinishin md, params IFilter[] additionalPhils)
        {
            List <IFilter> filters = new List <IFilter>(additionalPhils);

            filters.Add(KwoteModelFilterInfo.MagicFilter(md.MagicNumber));

            filters.Add(KwoteModelFilterInfo.DangerFilter(md.DangerNumber));

            return(new MootaDootaFilterCollection(filters));
        }
Пример #3
0
        public static IFilter Create(MootaDootaDefinishin md)
        {
            List <IFilter> mdFilters = new List <IFilter>();

            mdFilters.Add(KwestionaireModelFilterInfo.MagicFilter(md.MagicNumber));

            mdFilters.Add(KwestionaireModelFilterInfo.DangerFilter(md.DangerNumber));

            return(new MootaDootaFilterCollection(mdFilters));
        }
Пример #4
0
        /*
         *
         * */
        static void Main(string[] args)
        {
            MootaDootaDefinishin md = new MootaDootaDefinishin();

            md.DangerNumber = 5;
            md.MagicNumber  = 9;
            string filterString       = "MurderousSentientRollerCoasterModel.IsConfinedToRails == false && MurderousSentientRollerCoasterModel.VictimCount > 0";
            BigBadFilterProvider bbfp = new BigBadFilterProvider();

            bbfp.CreateMetadataFiler(0, filterString, md);
        }
        public static IFilter Create(MootaDootaDefinishin md)
        {
            List <IFilter> metadataFilters = new List <IFilter>()
            {
                MetadataFilterInfo.Create <int>(n => n == 1, "Section 1")
            };

            metadataFilters.Add(KwestionaireModelFilterInfo.MagicFilter(md.MagicNumber));

            metadataFilters.Add(KwestionaireModelFilterInfo.DangerFilter(md.DangerNumber));

            return(new MootaDootaFilterCollection(metadataFilters));
        }
 public static IFilter Create(MootaDootaDefinishin md)
 {
     return(Create(md, new IFilter[0]));
 }