IEnumerator TryChangeProjectType(ProjectConfigTypes configType) { if (_projectHandler.HasProjectConfigChanged()) { var fileName = Path.GetFileName(ProjenyEditorUtil.GetProjectConfigPath(_view.ProjectConfigType)); var choice = _view.PromptForUserChoice( "Do you want to save changes to {0}?".Fmt(fileName), new[] { "Save", "Don't Save", "Cancel" }, null, null, 0, 2); yield return(choice); switch (choice.Current) { case 0: { _projectHandler.OverwriteConfig(); break; } case 1: { // Do nothing break; } case 2: { yield break; } default: { Assert.Throw(); break; } } } _view.ProjectConfigType = configType; _projectHandler.RefreshProject(); }