Пример #1
0
 async Task IPostToBot.PostAsync(IActivity activity, CancellationToken token)
 {
     var locale = await this.localeFinder.FindLocale(activity, token);
     using (var localeScope = new LocalizedScope(locale))
     {
         await this.inner.PostAsync(activity, token);
     }
 }
Пример #2
0
        public async Task LoadAsync(CancellationToken token)
        {
            await this.inner.LoadAsync(token);

            var locale = await this.localeFinder.FindLocale(this.activity, token);

            // The localeScope should be set before dialog stack is deserialized.
            // This enables dialogs, i.e. formflow dialog, to load the right resource for
            // the serialized instance.
            using (var localeScope = new LocalizedScope(locale))
            {
                await this.dialogTaskManager.LoadDialogTasks(token);
            }
        }