Esempio n. 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);
        }
Esempio n. 2
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));
        }
        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));
        }