/// <summary> /// Clones the specified object with the name enterd by user. /// </summary> /// <param name="buildingBlockToClone">The object to clone.</param> public IMoBiCommand Clone(TBuildingBlock buildingBlockToClone) { var name = DialogCreator.AskForInput(AppConstants.Dialog.AskForNewName(AppConstants.CloneName(buildingBlockToClone)), AppConstants.Captions.NewName, AppConstants.CloneName(buildingBlockToClone), _editTask.GetForbiddenNames(buildingBlockToClone, Context.CurrentProject.All <TBuildingBlock>())); if (string.IsNullOrEmpty(name)) { return(new MoBiEmptyCommand()); } var clone = InteractionTask.Clone(buildingBlockToClone).WithName(name); return(AddToProject(clone)); }