public void createItem(string path, EditorController editorController) { String fullPath = Path.Combine(path, Name); rmlTypeController.createRmlFileSafely(fullPath); String timelineName = timelineTypeController.createTimelineFileSafely(fullPath); AnomalousMvcContext mvcContext = mvcTypeController.CurrentObject; if (mvcContext != null) { String name = PathExtensions.RemoveExtension(fullPath); if (mvcContext.Views.hasItem(name)) { MessageBox.show(String.Format("A view named '{0}' already exists. Would you like to overwrite it?", name), "Overwrite?", MessageBoxStyle.IconQuest | MessageBoxStyle.Yes | MessageBoxStyle.No, (result) => { if (result == MessageBoxStyle.Yes) { mvcContext.Views.remove(mvcContext.Views[name]); createView(mvcContext, name, BackButton); } }); } else { createView(mvcContext, name, BackButton); } if (mvcContext.Controllers.hasItem(name)) { MessageBox.show(String.Format("A controller named '{0}' already exists. Would you like to overwrite it?", name), "Overwrite?", MessageBoxStyle.IconQuest | MessageBoxStyle.Yes | MessageBoxStyle.No, (result) => { if (result == MessageBoxStyle.Yes) { mvcContext.Controllers.remove(mvcContext.Controllers[name]); createController(mvcContext, name, timelineName, BackButton); } }); } else { createController(mvcContext, name, timelineName, BackButton); } editorController.saveAllCachedResources(); } }