MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Paste

Method Paste

Source/Editor/Windows/ContentWindow.cs:936–956  ·  view source on GitHub ↗

Pastes the specified files. The files paths to import. Whether a cutting action is occuring.

(string[] files, bool isCutting)

Source from the content-addressed store, hash-verified

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.

Callers 1

GameWindowMethod · 0.45

Calls 7

FindMethod · 0.45
NormalizePathMethod · 0.45
EqualsMethod · 0.45
MoveMethod · 0.45
CopyMethod · 0.45
AddMethod · 0.45
ImportMethod · 0.45

Tested by

no test coverage detected