public CremaHost(CremaSettings settings, [ImportMany] IEnumerable <IRepositoryProvider> repoProviders) { CremaLog.Debug("crema instance created."); this.settings = settings; this.basePath = settings.BasePath; this.repositoryPath = Path.Combine(settings.BasePath, settings.RepositoryName); this.trunkPath = Path.Combine(this.repositoryPath, trunkString); this.tagsPath = Path.Combine(this.repositoryPath, tagsString); this.branchesPath = Path.Combine(this.repositoryPath, branchesString); this.workingPath = Path.Combine(this.basePath, workingString); this.repositoryProvider = repoProviders.First(item => item.Name == this.settings.RepositoryModule); this.repositoryProvider.ValidateRepository(this.basePath, this.repositoryPath); this.log = new LogService(this.GetType().FullName, this.WorkingPath) { Name = "repository", Verbose = settings.Verbose }; CremaLog.Debug("crema log service initialized."); CremaLog.Debug($"available tags : {string.Join(", ", TagInfoUtility.Names)}"); if (settings.MultiThreading == true) { this.dispatcher = new CremaDispatcher(this); } else { this.dispatcher = new CremaDispatcher(this, System.Windows.Threading.Dispatcher.CurrentDispatcher); } this.repositoryDispatcher = new CremaDispatcher(this.repositoryProvider); CremaLog.Debug("crema dispatcher initialized."); }
public virtual IEnumerable <Assembly> GetAssemblies() { var assemblyList = new List <Assembly>(); if (Assembly.GetEntryAssembly() != null) { assemblyList.Add(Assembly.GetEntryAssembly()); } var query = from directory in EnumerableUtility.Friends(AssemblyDirectoryPath, this.SelectPath()) let catalog = new DirectoryCatalog(directory) from file in catalog.LoadedFiles select file; foreach (var item in query) { try { var assembly = Assembly.LoadFrom(item); assemblyList.Add(assembly); CremaLog.Debug(assembly.Location); } catch { } } return(assemblyList.Distinct()); }
public async void RemoveService(ICremaService service) { if (this.services.Contains(service) == false) { return; } this.services.Remove(service); CremaLog.Debug($"{service.GetType().Name} Released."); if (this.services.Any() == false) { await this.dispatcher.InvokeAsync(() => { this.InvokeClose(this.closeInfo); }); } }
public CremaHost() { this.dispatcher = new CremaDispatcher(this); CremaLog.Debug($"available tags : {string.Join(",", TagInfoUtility.Names)}"); CremaLog.Debug("Crema created."); }
public void AddService(ICremaService service) { this.services.Add(service); CremaLog.Debug($"{service.GetType().Name} Initialized."); }
public CremaBootstrapper() { this.Initialize(); this.settings.RepositoryModule = DefaultRepositoryModule; CremaLog.Debug("default repository module : {0}", this.settings.RepositoryModule); }
private void Initialize() { CremaLog.Debug("Initialize."); this.OnInitialize(); CremaLog.Debug("Initialized."); }