Beispiel #1
0
 private void PerformImport(IResource importRoot, bool addToWorkspace)
 {
     _imported = true;
     if (addToWorkspace)
     {
         _oldRSSFeedList = Core.ResourceStore.GetAllResources("RSSFeed");
         // Instantinate
         _oldRSSFeedList.IndexOf(importRoot);
     }
     foreach (HashSet.Entry importerName in  _selectedFeedImporters)
     {
         IFeedImporter importer = _feedImporters[importerName.Key as string] as IFeedImporter;
         try
         {
             importer.DoImport(importRoot, addToWorkspace);
         }
         catch (Exception ex)
         {
             Core.UIManager.QueueUIJob(new ErrorReportJob(ReportImportError), importerName.Key as string, ex.Message);
         }
     }
     // Schedule all feeds to update
     if (addToWorkspace)
     {
         ScheduleForUpdate(importRoot);
         _oldRSSFeedList = null;
     }
 }
Beispiel #2
0
 public ImportExecutor(IFeedImporter feedImporter,
                       IOutfitUpdaterRepository outfitUpdaterRepository,
                       ITrendRepository trendRepository,
                       ISilouhetteRepository silouhetteRepository,
                       IPatternRepository patternRepository,
                       IColorFamilyRepository colorFamilyRepository,
                       IPartnerRepository partnerRepository)
 {
     this.feedImporter            = feedImporter;
     this.outfitUpdaterRepository = outfitUpdaterRepository;
     this.trendRepository         = trendRepository;
     this.silouhetteRepository    = silouhetteRepository;
     this.patternRepository       = patternRepository;
     this.colorFamilyRepository   = colorFamilyRepository;
     this.partnerRepository       = partnerRepository;
 }
Beispiel #3
0
 private void PerformImportCache()
 {
     _importedCache = true;
     foreach (HashSet.Entry importerName in  _selectedFeedImporters)
     {
         IFeedImporter importer = _feedImporters[importerName.Key as string] as IFeedImporter;
         try
         {
             importer.DoImportCache();
         }
         catch (Exception ex)
         {
             Core.UIManager.QueueUIJob(new ErrorReportJob(ReportCacheImportError), importerName.Key as string, ex.Message);
         }
     }
     _selectedFeedImporters = null;
 }
Beispiel #4
0
        private void _importFrom_itemChecked(object sender, ItemCheckEventArgs e)
        {
            string        name     = _importersNames[e.Index];
            IFeedImporter importer = (IFeedImporter)_manager.Importers[name];

            _manager.SelectImporter(_importersNames[e.Index], e.NewValue == CheckState.Checked);
            if (importer.HasSettings)
            {
                string paneName = ImportManager.ImportPaneName + "/" + name;
                if (e.CurrentValue != CheckState.Checked && e.NewValue == CheckState.Checked)
                {
                    if (_manager.Wizard != null)
                    {
                        _subPanes[name] = new OptionsPaneWizardAdapter(name, importer.GetSettingsPaneCreator());
                        _manager.Wizard.CurrentPane.RegisterPane(e.Index + 1, (AbstractWizardPane)_subPanes[name]);
                    }
                    else
                    {
                        Core.UIManager.RegisterWizardPane(paneName, importer.GetSettingsPaneCreator(), e.Index);
                    }
                }
                else if (e.CurrentValue == CheckState.Checked && e.NewValue != CheckState.Checked)
                {
                    if (_manager.Wizard != null)
                    {
                        _manager.Wizard.CurrentPane.DeregisterPane((AbstractWizardPane)_subPanes[name]);
                    }
                    else
                    {
                        Core.UIManager.DeRegisterWizardPane(paneName);
                    }
                }
            }
            if (_manager.ImportPossible != _chkPreview.Enabled)
            {
                _chkPreview.Enabled = _manager.ImportPossible;
                AddPreviewPane(_chkPreview.Enabled && _chkPreview.Checked);
            }
        }