Pastes the specified files. The files paths to import. Whether a cutting action is occuring.
(string[] files, bool isCutting)
| 934 | /// <param name="files">The files paths to import.</param> |
| 935 | /// <param name="isCutting">Whether a cutting action is occuring.</param> |
| 936 | public void Paste(string[] files, bool isCutting) |
| 937 | { |
| 938 | var importFiles = new List<string>(); |
| 939 | foreach (var sourcePath in files) |
| 940 | { |
| 941 | var item = Editor.ContentDatabase.Find(sourcePath); |
| 942 | if (item != null) |
| 943 | { |
| 944 | var newPath = StringUtils.NormalizePath(Path.Combine(CurrentViewFolder.Path, item.FileName)); |
| 945 | if (sourcePath.Equals(newPath)) |
| 946 | newPath = GetClonedAssetPath(item); |
| 947 | if (isCutting) |
| 948 | Editor.ContentDatabase.Move(item, newPath); |
| 949 | else |
| 950 | Editor.ContentDatabase.Copy(item, newPath); |
| 951 | } |
| 952 | else |
| 953 | importFiles.Add(sourcePath); |
| 954 | } |
| 955 | Editor.ContentImporting.Import(importFiles, CurrentViewFolder); |
| 956 | } |
| 957 | |
| 958 | /// <summary> |
| 959 | /// Starts creating the folder. |
no test coverage detected