public async Task LoadAsync()
        {
            using (progress.ShowBusy())
            {
                isWorking = true;
                Log.Debug($"Metadata model: {modelMetadata.ModelPaths} {DateTime.Now}");

                if (!File.Exists(modelMetadata.ModelPaths.ModelPath))
                {
                    message.ShowWarning($"Model not found:\n{modelMetadata.ModelFilePath}");
                    recentModelsService.RemoveModelPath(modelMetadata.ModelFilePath);
                    string targetPath = ProgramInfo.GetInstallFilePath();
                    cmd.Start(targetPath, "");
                    Application.Current.Shutdown(0);
                    return;
                }


                Root.ItemsCanvas.IsZoomAndMoveEnabled = true;

                M result = await TryShowModelAsync();

                if (result.IsFaulted)
                {
                    message.ShowWarning(result.ErrorMessage);
                    string targetPath = ProgramInfo.GetInstallFilePath();
                    cmd.Start(targetPath, "");
                    Application.Current.Shutdown(0);
                    return;
                }

                UpdateLines(Root);
                recentModelsService.AddModelPaths(modelMetadata.ModelFilePath);
                modelService.SetLayoutDone();


                GC.Collect();
                isWorking = false;
            }
        }
Пример #2
0
        private void StartInstalled()
        {
            string targetPath = ProgramInfo.GetInstallFilePath();

            cmd.Start(targetPath, "/run /d:Open");
        }