Example #1
0
 public CityEventFromFacebookImporter(EventDescriptionParser descriptionParser, FacebookEventFormat facebookEventFormat, FacebookEventRetriever facebookEventRetriever, MinMaxPriceExtractor minMaxPriceExtractor)
 {
     _descriptionParser      = descriptionParser;
     _facebookEventFormat    = facebookEventFormat;
     _facebookEventRetriever = facebookEventRetriever;
     _minMaxPriceExtractor   = minMaxPriceExtractor;
 }
Example #2
0
        public MainForm()
        {
            InitializeComponent();

            var cb = new ContainerBuilder();

            cb.RegisterModule <DiMainModule>();
            IContainer container = cb.Build();

            _importer   = container.Resolve <CityEventFromFacebookImporter>();
            _retriever  = container.Resolve <FacebookEventRetriever>();
            _fb         = container.Resolve <FacebookClient>();
            _fbLoginUri = _fb.GetLoginUrl(new
            {
                client_id     = Settings.Default.AppId,
                redirect_uri  = "https://www.facebook.com/connect/login_success.html",
                response_type = "token",
                scope         = "rsvp_event,user_events,publish_actions"
            });
            _eventFormat = container.Resolve <FacebookEventFormat>();
            InitializeChromium(_fbLoginUri.AbsoluteUri);
            try
            {
                using (var f = new StreamReader(EventsCSV))
                {
                    _events.AddRange(
                        container.Resolve <CsvStorage>().ReadAll(f).Select(
                            x =>
                    {
                        FixDescription(x);
                        return(x);
                    }));
                }
            }
            catch (FileNotFoundException)
            {
            }
            if (Settings.Default.SearchQueries != null)
            {
                QueryBox.Items.AddRange(Settings.Default.SearchQueries.Cast <object>().ToArray());
            }
        }