public CheckReminders(UserAccounts accounts, Global global, LoginFromConsole log) { _accounts = accounts; _global = global; _log = log; CheckTimer(); }
public static async Task InitializeServicesAsync(this IServiceProvider services) { var singletonServicesCount = 0; var transientServicesCount = 0; var watchSingleton = Stopwatch.StartNew(); foreach (var type in Assembly.GetEntryAssembly().GetTypes() .Where(x => typeof(IServiceSingleton).IsAssignableFrom(x) && !x.IsInterface)) { singletonServicesCount++; await((IServiceSingleton)services.GetRequiredService(type)).InitializeAsync(); } watchSingleton.Stop(); var watchTransient = Stopwatch.StartNew(); foreach (var type in Assembly.GetEntryAssembly().GetTypes() .Where(x => typeof(IServiceTransient).IsAssignableFrom(x) && !x.IsInterface)) { transientServicesCount++; await((IServiceTransient)services.GetRequiredService(type)).InitializeAsync(); } watchTransient.Stop(); var log = new LoginFromConsole(); log.Info($"\nSingleton Initialized count: {singletonServicesCount} ({watchSingleton.Elapsed:m\\:ss\\.ffff}s.)"); log.Info($"Transient Initialized count: {transientServicesCount} ({watchTransient.Elapsed:m\\:ss\\.ffff}s.)\n"); }
public Reminder(UserAccounts accounts, SecureRandom secureRandom, OctoNamePull octoNamePull, HelperFunctions helperFunctions, LoginFromConsole log, Global global) { _accounts = accounts; _secureRandom = secureRandom; _octoNamePull = octoNamePull; _helperFunctions = helperFunctions; _log = log; _global = global; }
public Config(LoginFromConsole log) { try { JsonConvert.PopulateObject(File.ReadAllText(@"DataBase/OctoDataBase/config.json"), this); } catch (Exception ex) { log.Critical(ex); Console.ReadKey(); Environment.Exit(-1); } }
public static IServiceCollection AutoAddTransient(this IServiceCollection services) { var transientServicesCount = 0; var watchTransient = Stopwatch.StartNew(); foreach (var type in Assembly.GetEntryAssembly().GetTypes() .Where(x => typeof(IServiceTransient).IsAssignableFrom(x) && !x.IsInterface)) { transientServicesCount++; services.AddTransient(type); } watchTransient.Stop(); var log = new LoginFromConsole(); log.Info($"Transient added count: {transientServicesCount} ({watchTransient.Elapsed:m\\:ss\\.ffff}s.)"); return(services); }
public static IServiceCollection AutoAddSingleton(this IServiceCollection services) { var singletonServicesCount = 0; var watchSingleton = Stopwatch.StartNew(); foreach (var type in Assembly.GetEntryAssembly().GetTypes() .Where(x => typeof(IServiceSingleton).IsAssignableFrom(x) && !x.IsInterface)) { singletonServicesCount++; services.AddSingleton(type); // type.GetInterfaces().FirstOrDefault(x => !(x is typeof(IServiceSingleton))) //x != typeof(IService) } watchSingleton.Stop(); var log = new LoginFromConsole(); log.Info($"Singleton added count: {singletonServicesCount} ({watchSingleton.Elapsed:m\\:ss\\.ffff}s.)"); return(services); }
public LoggingSystemDataStorage(LoginFromConsole log) { _log = log; }
public ServerDataStorage(LoginFromConsole log) { _log = log; }
public SpellDataStorage(LoginFromConsole log) { _log = log; }
public UserAccountsDataStorage(LoginFromConsole log) { _log = log; }