Esempio n. 1
0
        public async Task <bool> Upload(CustomCollectionLibraryItemViewModel collection)
        {
            var  scope  = CollectionScope.Private;
            bool?result = null;

            if (!await WrapAsync(collection, async() => {
                var collectionVisibilityViewModel =
                    _mediator.Send(new ShowCollectionVisibilityQuery(collection.Model.Id));
                result = (await _specialDialogManager.ShowDialog(collectionVisibilityViewModel)).GetValueOrDefault();
                scope = collectionVisibilityViewModel.Visibility;
            }))
            {
                return(false);
            }

            if (!result.GetValueOrDefault())
            {
                return(false);
            }

            await Publish(collection, scope).ConfigureAwait(false);

            if (scope != CollectionScope.Private)
            {
                await ShowCollectionCreatedDialog(collection);
            }

            return(true);
        }
Esempio n. 2
0
        public Task DiagnoseAndRepairSynqRepository()
        {
            var vm = new RepairViewModel();

            vm.ProcessCommand.Execute(null);
            return(_specialDialogManager.ShowDialog(vm));
        }
Esempio n. 3
0
        private async Task <RecoveryOptionResult> ErrorDialog(UserError error, Window window = null)
        {
            MainLog.Logger.FormattedWarnException(error.InnerException, "UserError");
            if (Common.Flags.IgnoreErrorDialogs)
            {
                return(RecoveryOptionResult.FailOperation);
            }
            var settings = new Dictionary <string, object>();

            if (window != null)
            {
                settings["Owner"] = window;
            }
            var t2 = error.RecoveryOptions.GetTask();
            await _specialDialogManager.ShowDialog(new UserErrorViewModel(error), settings).ConfigureAwait(false);

            return(await t2.ConfigureAwait(false));
        }
 async Task OpenNewProfileDialog()
 {
     ShowProfilesMenu = false;
     using (var vm = _mediator.Send(new ShowNewProfileDialogQuery()))
         await _specialDialogManager.ShowDialog(vm).ConfigureAwait(false);
 }