2 using System.Collections.Generic;
3 using System.ComponentModel;
5 using System.Threading.Tasks;
6 using SiliconStudio.Core.Diagnostics;
7 using SiliconStudio.Core.Serialization;
8 using SiliconStudio.Core.Serialization.Assets;
9 using SiliconStudio.Core.Storage;
11 namespace SiliconStudio.BuildEngine
13 [Description(
"File operation")]
17 public override string Title {
get {
return Type +
" " + (
Source ??
"[Source]"); } }
27 public string Target {
get; set; }
28 public bool Overwrite {
get; set; }
38 if (
File.Exists(Target))
42 commandContext.RegisterOutput(
new ObjectUrl(
UrlType.File, Target), ObjectId.Empty);
45 var sourceStream = File.OpenRead(Source);
46 var destStream = File.OpenWrite(Target);
47 await sourceStream.CopyToAsync(destStream);
48 commandContext.RegisterOutput(
new ObjectUrl(
UrlType.File, Target), ObjectId.Empty);
50 case Operation.Delete:
55 return ResultStatus.Successful;
59 commandContext.Logger.Error(e.Message);
60 return ResultStatus.Failed;
71 base.ComputeParameterHash(stream);
82 return Type +
" " + (
Source ??
"[Source]");
83 return Type +
" " + (
Source ??
"[Source]") +
" > " + (Target ??
"[Target]");
override void ComputeParameterHash(Stream stream)
override IEnumerable< ObjectUrl > GetInputFiles()
Gets the list of input files (that can be deduced without running the command, only from command para...
Implements SerializationStream as a binary writer.
override async Task< ResultStatus > DoCommandOverride(ICommandContext commandContext)
The method to override containing the actual command code. It is called by the DoCommand function ...
override string ToString()