public void LoadProject(string path, IProjectProvider provider) { if (provider == null) { return; } // load new project var newProjectInfo = provider.Load(path); // new project not exist if (string.IsNullOrWhiteSpace(newProjectInfo?.Path)) { MessageBox.Show(Resources.ProjectFileNotExistText, "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } // confirm close old project if (CurrentProjectInfo != null) { if (!ConfirmCloseCurrentProject()) { return; } CloseCurrentProject(); } // update current project CurrentProjectInfo = newProjectInfo; }