Exemplo n.º 1
0
        protected async System.Threading.Tasks.Task FinishGenerationAsync(UserSelection userSelection, string statusBarMessage)
        {
            if (userSelection is null)
            {
                return;
            }

            await SafeThreading.JoinableTaskFactory.SwitchToMainThreadAsync();

            _generationService.FinishGeneration(userSelection);
            await _shell.ShowStatusBarMessageAsync(statusBarMessage);
        }
Exemplo n.º 2
0
        protected async System.Threading.Tasks.Task FinishGenerationAsync(UserSelection userSelection, string statusBarMessage)
        {
            if (userSelection is null)
            {
                return;
            }

            await SafeThreading.JoinableTaskFactory.SwitchToMainThreadAsync();

            _generationService.FinishGeneration(userSelection);

            // TODO: Change all async GensShell methods to public
            await(_shell.UI as VsGenShellUI).ShowStatusBarMessageAsync(statusBarMessage);
        }
        private void FinishGeneration(UserSelection userSelection, string statusBarMessage)
        {
            if (userSelection is null)
            {
                return;
            }

            SafeThreading.JoinableTaskFactory.Run(
                async() =>
            {
                await SafeThreading.JoinableTaskFactory.SwitchToMainThreadAsync();
                _generationService.FinishGeneration(userSelection);
                _shell.ShowStatusBarMessage(statusBarMessage);
            },
                JoinableTaskCreationOptions.LongRunning);
        }