Esempio n. 1
0
        public ExecutorsVM(IExecutorRepository executorRep, AppSettings appSettings)
        {
            _repository    = executorRep;
            _isAllSelected = Filtered.All(x => x.IsSelected);
            Refresh();

            //_dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            //_dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
            //_dispatcherTimer.Interval = appSettings.RefreshUITimeout;
            //_dispatcherTimer.Start();
        }
Esempio n. 2
0
        public TelegramManager(AppDbContext dbContext, ITaskRepository taskRepository,
                               IExecutorRepository executorRepository)
        {
            TelegramSettings telegramSettings = new TelegramSettings {
                APIKey = "1013744878:AAF5qFktlgyBpXeVp-KXpWyb4dnTqUbSPN4"
            };

            _botClient = new Telegram.Bot.TelegramBotClient(telegramSettings.APIKey);
            NLog.LogManager.GetCurrentClassLogger().Info($"Telegram bot created:{telegramSettings.APIKey}");
            _taskRepository     = taskRepository;
            _executorRepository = executorRepository;
            _dbContext          = dbContext;

            _botClient.OnCallbackQuery       += _botClient_OnCallbackQuery;
            _botClient.OnReceiveError        += _botClient_OnReceiveError;
            _botClient.OnReceiveGeneralError += _botClient_OnReceiveGeneralError;
            _botClient.OnMessage             += _botClient_OnMessage;
            _botClient.OnInlineResultChosen  += _botClient_OnInlineResultChosen;
            _botClient.StartReceiving(Array.Empty <UpdateType>());
        }
Esempio n. 3
0
 public ExecutorDomainService(IExecutorRepository repository)
 {
     _executorRepository = repository;
 }