Example #1
0
 public DirectoryInfo GetAppDataDirectory(IApplicationNameProvider appNameProvider)
 {
     return(new DirectoryInfo(Path.Combine(GetRootDataDirectory().FullName, AppDataDirectory, appNameProvider.GetApplicationName())));
 }
Example #2
0
 public string GetClientId(IApplicationNameProvider nameProvider)
 {
     return(GetClientId(nameProvider.GetApplicationName()));
 }
 public override string GetApplicationClientId(IApplicationNameProvider nameProvider)
 {
     return("InvalidClientId_".RandomLetters(8));
 }
Example #4
0
 public override string GetApplicationClientId(IApplicationNameProvider nameProvider)
 {
     return(ClientId);
 }
Example #5
0
 public TextFileLogger(IApplicationNameProvider applicationNameProvider) : this()
 {
     ApplicationNameProvider = applicationNameProvider;
 }
Example #6
0
 public ApiKeyResolver(IApiKeyProvider apiKeyProvider, IApplicationNameProvider nameProvider) : this()
 {
     ApiKeyProvider          = apiKeyProvider;
     ApplicationNameProvider = nameProvider;
 }
Example #7
0
 public string GetApplicationClientId(IApplicationNameProvider nameProvider)
 {
     return(ApiKeyProvider.GetApplicationClientId(nameProvider));
 }
Example #8
0
 public DirectoryInfo GetAppWorkspaceDirectory(IApplicationNameProvider appNameProvider, string workspaceName, string hash)
 {
     return(new DirectoryInfo(Path.Combine(GetAppDataDirectory(appNameProvider).FullName, WorkspacesDirectory, workspaceName, hash)));
 }
Example #9
0
 public DirectoryInfo GetAppEmailTemplatesDirectory(IApplicationNameProvider appNameProvider)
 {
     return(GetAppDataDirectory(appNameProvider, EmailTemplatesDirectory));
 }
Example #10
0
 public DirectoryInfo GetAppFilesDirectory(IApplicationNameProvider appNameProvider)
 {
     return(GetAppDataDirectory(appNameProvider, FilesDirectory));
 }
Example #11
0
        public DirectoryInfo GetAppWorkspaceDirectory(IApplicationNameProvider appNameProvider, Type type)
        {
            string hash = type.ToInfoHash();

            return(GetAppWorkspaceDirectory(appNameProvider, type.Name, hash));
        }
Example #12
0
 public DirectoryInfo GetAppRepositoryWorkspaceDirectory(IApplicationNameProvider appNameProvider)
 {
     return(GetAppDataDirectory(appNameProvider, WorkspacesDirectory));
 }
Example #13
0
 public DirectoryInfo GetAppRepositoryDirectory(IApplicationNameProvider appNameProvider, string subDirectory)
 {
     return(new DirectoryInfo(Path.Combine(GetAppDataDirectory(appNameProvider).FullName, subDirectory)));
 }
Example #14
0
 public DirectoryInfo GetAppDataDirectory(IApplicationNameProvider appNameProvider, string directoryName)
 {
     return(new DirectoryInfo(Path.Combine(GetAppDataDirectory(appNameProvider).FullName, directoryName)));
 }
 public override string GetApplicationClientId(IApplicationNameProvider nameProvider)
 {
     return(DefaultConfiguration.GetAppSetting("ClientId", true));
 }
Example #16
0
 public override SQLiteDatabase GetAppDatabaseFor(IApplicationNameProvider appNameProvider, object instance)
 {
     return(GetDatabaseFor(instance.GetType(), () => GetAppDatabaseDirectory(appNameProvider).FullName));
 }
Example #17
0
        public static ServiceRegistryService GetLocalServiceRegistryService(DataSettings dataSettings, IApplicationNameProvider appNameProvider, string assemblySearchPattern, ILogger logger = null)
        {
            logger = logger ?? Log.Default;
            DaoRepository             repo        = dataSettings.GetSysDaoRepository(logger, nameof(FileService));
            FileService               fileService = new FileService(repo);
            AssemblyServiceRepository assRepo     = new AssemblyServiceRepository();

            assRepo.Database = dataSettings.GetSysDatabaseFor(assRepo);
            assRepo.EnsureDaoAssemblyAndSchema();
            AssemblyService           assemblyService     = new AssemblyService(DataSettings.Current, fileService, assRepo, appNameProvider);
            ServiceRegistryRepository serviceRegistryRepo = new ServiceRegistryRepository();

            serviceRegistryRepo.Database = dataSettings.GetSysDatabaseFor(serviceRegistryRepo);
            serviceRegistryRepo.EnsureDaoAssemblyAndSchema();
            ServiceRegistryService serviceRegistryService = new ServiceRegistryService(
                fileService,
                assemblyService,
                serviceRegistryRepo,
                dataSettings.GetSysDaoRepository(logger),
                new AppConf {
                Name = appNameProvider.GetApplicationName()
            }
                )
            {
                AssemblySearchPattern = assemblySearchPattern
            };

            return(serviceRegistryService);
        }
Example #18
0
 public override SQLiteDatabase GetAppDatabaseFor(IApplicationNameProvider appNameProvider, Type objectType, string info = null)
 {
     return(GetDatabaseFor(objectType, () => GetAppDatabaseDirectory(appNameProvider).FullName, info));
 }
Example #19
0
 public ApiKeyInfo GetApiKeyInfo(IApplicationNameProvider nameProvider)
 {
     return(ApiKeyProvider.GetApiKeyInfo(nameProvider));
 }
Example #20
0
 /// <summary>
 /// Get the path to the application specific SQLite database file for the specified type
 /// </summary>
 /// <param name="appNameProvider"></param>
 /// <param name="type"></param>
 /// <param name="info"></param>
 /// <returns></returns>
 public override string GetAppDatabasePathFor(IApplicationNameProvider appNameProvider, Type type, string info = null)
 {
     return(GetAppDatabaseFor(appNameProvider, type, info).DatabaseFile.FullName);
 }
Example #21
0
 public abstract string GetApplicationClientId(IApplicationNameProvider nameProvider);
Example #22
0
 public override SQLiteDatabase GetAppDatabase(IApplicationNameProvider appNameProvider, string databaseName)
 {
     return(new SQLiteDatabase(GetAppDatabaseDirectory(appNameProvider).FullName, databaseName));
 }
Example #23
0
 public string GetApplicationClientId(IApplicationNameProvider nameProvider)
 {
     CoreServices.ApplicationRegistration.Data.Application app = ApplicationRegistrationRepository.OneApplicationWhere(c => c.Name == nameProvider.GetApplicationName());
     return(app?.Cuid);
 }
Example #24
0
 public void SetRuntimeAppDataDirectory(IApplicationNameProvider appNameProvider)
 {
     RuntimeSettings.AppDataFolder = GetAppDataDirectory(appNameProvider).FullName;
 }
 public ConfigurationServiceCredentialProvider(string coreConfigurationServerHost, IApplicationNameProvider appNameProvider, int port = 80, ILogger logger = null)
 {
     SettingSource           = SettingSource.DefaultConfigurationFile;
     ConfigurationServerHost = coreConfigurationServerHost;
     ConfigurationServerPort = port;
     Logger = logger ?? Log.Default;
     ApplicationNameProvider = appNameProvider;
     _passwordRetrievers     = new Dictionary <SettingSource, Func <string> >()
     {
         { SettingSource.Invalid, () => throw new InvalidOperationException() },
Example #26
0
 public AssemblyService(DataSettings dataSettings, IFileService fileService, Repo.AssemblyServiceRepository repo, IApplicationNameProvider appNameProvider)
 {
     DataSettings = dataSettings;
     FileService  = fileService;
     AssemblyManagementRepository     = repo;
     ApplicationNameProvider          = appNameProvider;
     LoadCurrentRuntimeDescriptorTask = RegisterCurrentRuntimeDescriptor();
 }
        }                                       // to enable auto proxy gen

        public CoreUserRegistryService(IDatabaseProvider dbProvider, IUserManager wrapped, IApplicationNameProvider appNameProvider, IUserResolver userResolver, IRoleResolver roleResolver)
        {
            DatabaseProvider        = dbProvider;
            UserManager             = wrapped;
            ApplicationNameProvider = appNameProvider;
            UserResolver            = userResolver;
            RoleResolver            = roleResolver;
            dbProvider.SetDatabases(this);
            dbProvider.SetDatabases(UserManager);
            dbProvider.SetDatabases(ApplicationNameProvider);
            WireUserManagementEvents();
        }
Example #28
0
 public ApiKeyInfo(IApplicationNameProvider nameProvider)
 {
     ApplicationNameProvider = nameProvider;
 }
Example #29
0
 public AssemblyService(IFileService fileService, Repo.AssemblyServiceRepository repo, IApplicationNameProvider appNameProvider)
 {
     FileService = fileService;
     AssemblyManagementRepository     = repo;
     ApplicationNameProvider          = appNameProvider;
     LoadCurrentRuntimeDescriptorTask = LoadCurrentRuntimeDescriptor();
 }
Example #30
0
 public DirectoryInfo GetAppAssemblyDirectory(IApplicationNameProvider appNameProvider)
 {
     return(GetAppDataDirectory(appNameProvider, AssemblyDirectory));
 }