Exemplo n.º 1
0
        private async void CreateBotCommandExecute(object obj)
        {
            Bot result;

            result = await TryAsync(BotsClient.CreateBotAsync(Model.WorkerID));

            if (result == null)
            {
                return;
            }
            Bot = new BotViewModel(PIOClient, BotsClient, TranslationModule);
            await Bot.LoadAsync(result);
        }
Exemplo n.º 2
0
        protected override async Task OnRefreshAsync()
        {
            Bot bot;

            await base.OnRefreshAsync();

            await Tasks.RefreshAsync();

            bot = await BotsClient.GetBotForWorkerAsync(Model.WorkerID);

            if (bot == null)
            {
                Bot = null;
            }
            else
            {
                Bot = new BotViewModel(PIOClient, BotsClient, TranslationModule);
                await Bot.LoadAsync(bot);
            }
        }
Exemplo n.º 3
0
        protected override async Task OnLoadAsync(Worker Model)
        {
            Bot bot;

            Tasks = new TasksViewModel(PIOClient, BotsClient, TranslationModule, Model.WorkerID);
            await Tasks.LoadAsync();

            Task = Tasks.FirstOrDefault();

            bot = await BotsClient.GetBotForWorkerAsync(Model.WorkerID);

            if (bot == null)
            {
                Bot = null;
            }
            else
            {
                Bot = new BotViewModel(PIOClient, BotsClient, TranslationModule);
                await Bot.LoadAsync(bot);
            }
        }