Exemplo n.º 1
0
        public override void Execute(object parameter)
        {
            if (ItemSelected == null || ItemSelected.FileHandler == null)
            {
                return;
            }

            ProjectItem newItem = new ProjectItem(ItemSelected.GetContent());

            string name = ProjectItemFileSystem.GetValidFileName(
                ItemSelected.FileHandler.Path,
                newItem.DisplayName,
                Util.GetExtensionByType(ItemSelected.Type));

            newItem.RenamedFromAction = true;
            newItem.DisplayName       = name;

            SignalManager.Get <RegisterHistoryActionSignal>().Dispatch(new DuplicateProjectItemHistoryAction(newItem));

            SignalManager.Get <PasteElementSignal>().Dispatch(ItemSelected, newItem);

            ProjectItemFileSystem.CreateFileElement(newItem, ItemSelected.FileHandler.Path, name);
        }