Beispiel #1
0
        public FileService(EmojiContext context, EventService events, EmojiPadConfiguration config)
        {
            _context = context;
            _event   = events;
            _config  = config;
            context.Database.Migrate();

            if (!Directory.Exists(_config.EmojiFolderPath))
            {
                Directory.CreateDirectory(_config.EmojiFolderPath);
            }

            Task.Run(() =>
            {
                while (Program.Running)
                {
                    Thread.Sleep(1000);
                    try
                    {
                        if (SyncEmojiCache())
                        {
                            _event.SetBusy();
                            context.SaveChanges();
                            Thread.Sleep(1000);
                            _event.InvokeRefreshEmojis();
                        }
                    }
                    catch
                    {
                        // ignored
                    }
                }
            });
        }
Beispiel #2
0
 public SearchService(EmojiPadConfiguration configuration, EmojiContext context, EventService events)
 {
     _configuration = configuration;
     _context       = context;
     _event         = events;
 }
Beispiel #3
0
 public EmojiLoaderService(EmojiContext context, EmojiPadConfiguration config)
 {
     _context = context;
     _config  = config;
 }