Пример #1
0
        private void ImportAsync(ImportModel model)
        {
            ProcessManager.RunMainProcessAsync(mindmapStore, async() =>
            {
                List <ImportResult> results = null;
                try
                {
                    results = await model.Source.ImportAsync(model.Importer);
                }
                catch
                {
                    await MessageDialogService.AlertLocalizedAsync("ImportFailed_Alert");
                }

                if (results?.Count > 0)
                {
                    foreach (var result in results)
                    {
                        await mindmapStore.AddAsync(result.Name, result.Document);
                    }

                    await mindmapStore.OpenAsync(mindmapStore.AllFiles.FirstOrDefault());
                }
            }).Forget();
        }