Пример #1
0
        protected override void Activate()
        {
            base.Activate();
            TreeRegionWidth = new GridLength(settingService.GetTreeRegionWidth());

            moduleManager.LoadModule(typeof(TreeModue).Name);
            ActivateView(RegionNames.TreeRegion, typeof(Tree));

            if (!String.IsNullOrEmpty(untappdService.FilePath))
            {
                interactionRequestService.ShowMessageOnStatusBar(CommunicationHelper.GetLoadingMessage(untappdService.FilePath));
            }
        }
Пример #2
0
        private async void DownloadFiles()
        {
            List <Checkin> checkins = untappdService.GetCheckins();
            int            count    = checkins.Count;
            int            counter  = 1;

            foreach (Checkin checkin in checkins)
            {
                interactionRequestService.ShowMessageOnStatusBar(CommunicationHelper.GetLoadingMessage($"{counter++}/{count} -> {checkin.Beer.Name}"));
                await Task.Run(() => DownloadFiles(checkin));
            }
            interactionRequestService.ShowMessageOnStatusBar(CommunicationHelper.GetLoadingMessage(untappdService.FilePath));
        }
Пример #3
0
        private async void UploadProjectPhotosAsync(List <long> checkinIds, string uploadDirectory)
        {
            for (int i = 0; i < checkinIds.Count; i++)
            {
                Checkin checkin = untappdService.GetCheckin(checkinIds[i]);
                if (checkin == null || String.IsNullOrEmpty(checkin.UrlPhoto))
                {
                    continue;
                }

                string message = $"{Properties.Resources.Loading} {i + 1}/{checkinIds.Count}: {checkin.UrlPhoto}";
                interactionRequestService.ShowMessageOnStatusBar(message);
                await Task.Run(() => UploadCheckinPhoto(checkin, uploadDirectory));
            }
            interactionRequestService.ShowMessageOnStatusBar(CommunicationHelper.GetLoadingMessage(untappdService.FilePath));
        }