private async void OpenFile_Click(object sender, EventArgs e) { try { progressBar1.Visible = true; IRepositoryLoader loader = CastleFactory.Container.Resolve <IRepositoryLoader>(); loader.FileName = AppGlobalSettings.DataFileName; //loader.SetDelegate(Progress); Task t1 = Task.Run(() => loader.Execute()); Task t2 = Progress(); await Task.WhenAll(new[] { t1, t2 }); progressBar1.Visible = false; repo.StarsList = loader.StarsList; bsSpectralClass.DataSource = repo.StarsList; dvgSpectralClass.DataSource = bsSpectralClass; ActivateMenu(); } catch (NotImplementedException ex) { LogUtility.ErrorLog($"Error №1 {ex.Message}"); MessageBox.Show($"Error №1 {ex.Message}"); } catch (Exception ex) { MessageBox.Show($"Error №2 {ex.Message}"); } }
public LuceneSearcher(ISchemeRepository structRepository, IRepositoryLoader repositoryLoader, IDataRepository dataRepository, ISearchStatistics statisticsManager) { _structRepository = structRepository; _repositoryLoader = repositoryLoader; _dataRepository = dataRepository; _statisticsManager = statisticsManager; _syncService = new Colosoft.SearchEngine.Services.SyncSearchService(this); }
public DataRepository(IRepositoryLoader loader) { if (loader == null) { throw new ArgumentNullException("loader"); } _loader = loader; }
public void Initialize() { spectralClasses = new SpectralClassRepository(); AppGlobalSettings.Initialize(); loader = CastleFactory.Container.Resolve <IRepositoryLoader>(); loader.FileName = AppGlobalSettings.DataFileName; loader.Execute(); spectralClasses.StarsList = loader.StarsList; }
public XmlImportFull(Lazy <Import> importerLazy, Lazy <CmsManager> cmsManagerLazy, Lazy <DbDataController> dbDataForNewApp, Lazy <DbDataController> dbDataForAppImport, IImportExportEnvironment importExportEnvironment, IRepositoryLoader repositoryLoader, ITargetTypes metaTargetTypes) : base(importerLazy, dbDataForNewApp, dbDataForAppImport, importExportEnvironment, metaTargetTypes, "Sxc.XmlImp") { _cmsManagerLazy = cmsManagerLazy; _repositoryLoader = repositoryLoader.Init(Log); }
public ListCommand(ILogger <ListCommand> logger, IRepositoryLoader repositoryLoader) { this.Logger = logger; this.RepositoryLoader = repositoryLoader; }