Beispiel #1
0
        /// <summary>
        /// Run the listener and processor
        /// </summary>
        protected override void ConfigureProcessors()
        {
            PropertyValueMatcher <Band> bandMatcher = new PropertyValueMatcher <Band>(this, DataManager, "Name");

            ComponentContainer.RegisterInstance <ITextMatcher <Band> >("BandTourDateMatchingProcessor", bandMatcher);

            RegexMatcher <TourDate> regexMatcher = new RegexMatcher <TourDate>(this, DataManager);

            ComponentContainer.RegisterInstance <ITextMatcher <TourDate> >("BandTourDateMatchingProcessor", regexMatcher);

            ParentChildMatchingProcessor <Band, TourDate> bandTourDateMatchingProcessor =
                new ParentChildMatchingProcessor <Band, TourDate>(this, DataManager, "BandTourDateMatchingProcessor");

            ComponentContainer.RegisterInstance <IContentProcessor>(bandTourDateMatchingProcessor.Name, bandTourDateMatchingProcessor);

            bandTourDateMatchingProcessor.SetParentChildLink("ID", "BandID");
        }
Beispiel #2
0
        /// <summary>
        /// Run the listener and processor
        /// </summary>
        protected override void ConfigureProcessors()
        {
            PropertyValueMatcher <Band> bandMatcher = new PropertyValueMatcher <Band>(this,
                                                                                      () => DataManager.GetDataContext <Band>().GetAll <Band>(),
                                                                                      "Name");

            ComponentContainer.RegisterInstance <ITextMatcher <Band> >("BandTourDateMatchingProcessor", bandMatcher);

            RegexMatcher <TourDate> regexMatcher = new RegexMatcher <TourDate>(this,
                                                                               () => DataManager.GetDataContext <Regex>().GetByModuleID <Regex>(ID).Select(r => new RSSRegex(r)));

            ComponentContainer.RegisterInstance <ITextMatcher <TourDate> >("BandTourDateMatchingProcessor", regexMatcher);

            ParentChildMatchingProcessor <Band, TourDate> bandTourDateMatchingProcessor =
                new ParentChildMatchingProcessor <Band, TourDate>(this,
                                                                  "BandTourDateMatchingProcessor",
                                                                  (tourDates) => DataManager.GetDataContext <TourDate>().AddObjects <TourDate>(tourDates.ToList()));

            ComponentContainer.RegisterInstance <IContentProcessor>(bandTourDateMatchingProcessor.Name, bandTourDateMatchingProcessor);

            bandTourDateMatchingProcessor.SetParentChildLink("ID", "BandID");
        }