internal static IProjectListLoader CreateProjectListLoader(string hostname, DataCacheOperator op, DataCacheConnectionContext context, InternalCacheUpdater cache) { IProjectListLoader listLoader = null; if (context.CustomData is ProjectBasedContext) { listLoader = new ProjectBasedProjectListLoader(op, cache, context); } else if (context.CustomData is SearchBasedContext) { listLoader = new SearchBasedProjectListLoader(hostname, op, cache, context); } return(listLoader); }
private DataCacheInternal createCacheInternal( InternalCacheUpdater cacheUpdater, string hostname, IHostProperties hostProperties, User user, DataCacheConnectionContext context) { MergeRequestManager mergeRequestManager = new MergeRequestManager( _dataCacheContext, cacheUpdater, hostname, hostProperties, context, _modificationNotifier); DiscussionManager discussionManager = new DiscussionManager( _dataCacheContext, hostname, hostProperties, user, mergeRequestManager, context, _modificationNotifier); TimeTrackingManager timeTrackingManager = new TimeTrackingManager( hostname, hostProperties, user, discussionManager, _modificationNotifier); IProjectListLoader loader = ProjectListLoaderFactory.CreateProjectListLoader( hostname, _operator, context, cacheUpdater); ProjectCache projectCache = new ProjectCache(cacheUpdater, loader, _dataCacheContext); return(new DataCacheInternal(mergeRequestManager, discussionManager, timeTrackingManager, projectCache)); }
internal ProjectCache(IProjectListLoader projectListLoader, DataCacheContext context, string hostname) { _projectListLoader = projectListLoader; _context = context; _hostname = hostname; _context.SynchronizeInvoke.BeginInvoke(new Action( async() => { try { await _projectListLoader.Load(); } catch (BaseLoaderException ex) { if (ex is BaseLoaderCancelledException) { return; } ExceptionHandlers.Handle("Cannot load list of projects", ex); } }), null); }