Catrobat.IDE.Core.ViewModels.Service.OnlineProgramViewModel.DownloadAction C# (CSharp) Method

DownloadAction() private method

private DownloadAction ( OnlineProgramHeader programHeader ) : void
programHeader Catrobat.IDE.Core.CatrobatObjects.OnlineProgramHeader
return void
        private async void DownloadAction(OnlineProgramHeader programHeader)
        {
            /*lock (_importLock)
            {
                if (IsImporting)
                {
                    ServiceLocator.NotifictionService.ShowMessageBox(
                        AppResourcesHelper.Get("Main_OnlineProgramLoading"),
                        AppResourcesHelper.Get("Main_OnlineProgramDownloadBusy"),
                        CancelImportCallback,  MessageBoxOptions.Ok);
                    return;
                }

                IsImporting = true;
            }

            var message = new GenericMessage<string>(programHeader.ProjectName);
            Messenger.Default.Send(message, ViewModelMessagingToken.DownloadProgramStartedListener);

            try
            {
                ServiceLocator.DispatcherService.RunOnMainThread(() =>
                    ServiceLocator.NavigationService.NavigateBack<OnlineProgramViewModel>());

                ServiceLocator.ProgramImportService.SetDownloadHeader(programHeader);
                await Task.Run(() => ServiceLocator.ProgramImportService.TryImportWithStatusNotifications()).ConfigureAwait(false);
            }
            finally
            {
                ServiceLocator.DispatcherService.RunOnMainThread(() =>
                {
                    lock (_importLock) { IsImporting = false; }
                });
            }*/
        }