예제 #1
0
 public CheckReminders(UserAccounts accounts, Global global, LoginFromConsole log)
 {
     _accounts = accounts;
     _global   = global;
     _log      = log;
     CheckTimer();
 }
예제 #2
0
        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");
        }
예제 #3
0
 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;
 }
예제 #4
0
파일: Config.cs 프로젝트: mylorik/OctoGame
 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);
     }
 }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
 public LoggingSystemDataStorage(LoginFromConsole log)
 {
     _log = log;
 }
예제 #8
0
 public ServerDataStorage(LoginFromConsole log)
 {
     _log = log;
 }
예제 #9
0
 public SpellDataStorage(LoginFromConsole log)
 {
     _log = log;
 }
 public UserAccountsDataStorage(LoginFromConsole log)
 {
     _log = log;
 }