コード例 #1
0
ファイル: MainForm.cs プロジェクト: sexyDaniel/Kpo_Laba
        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}");
            }
        }
コード例 #2
0
 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);
 }
コード例 #3
0
 public DataRepository(IRepositoryLoader loader)
 {
     if (loader == null)
     {
         throw new ArgumentNullException("loader");
     }
     _loader = loader;
 }
コード例 #4
0
 public void Initialize()
 {
     spectralClasses = new SpectralClassRepository();
     AppGlobalSettings.Initialize();
     loader          = CastleFactory.Container.Resolve <IRepositoryLoader>();
     loader.FileName = AppGlobalSettings.DataFileName;
     loader.Execute();
     spectralClasses.StarsList = loader.StarsList;
 }
コード例 #5
0
 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);
 }
コード例 #6
0
ファイル: ListCommand.cs プロジェクト: mvromer/Stamp
 public ListCommand(ILogger <ListCommand> logger,
                    IRepositoryLoader repositoryLoader)
 {
     this.Logger           = logger;
     this.RepositoryLoader = repositoryLoader;
 }