-
Notifications
You must be signed in to change notification settings - Fork 66
RoboCommand
Jeff Ward edited this page Mar 16, 2022
·
6 revisions
Property Name | Property Type | Description |
---|---|---|
Name | string | Custom Name for the object to refer to it by - Has no effect on functionality. |
See IRoboCommand for Event Details
- Methods can be overridden in derived classes to provide custom functionality, while still allowing usage of RoboQueue.
- All methods that start the RoboCopy process call this method, so overriding it will affect all other Start* calls.
- Below is an example of an override for this method:
public override Task Start(string domain = "", string username = "", string password = "")
{
if (!IsValidForSync) return Task.Delay(0); //IsValidForSync is a property of the derived class
System.IO.File.AppendAllLines(MyApplication.LogFilePath, $"Starting RobotCopy Command: \n{this.GetCommandText()}");
return base.Start(domain,username,password);
}
- The base method simply awaits Start(), then returns the result of GetResults() method.
- Below is an example of an override for this method:
public override async Task<RoboCopyResults> StartAsync(string domain = "", string username = "", string password = "")
{
if (!IsValidForSync) return null; //IsValidForSync is a property of the derived class
return await base.StartAsync(domain,username,password);
}
If using the both above overrides, StartAsync will:
- Evalaute IsValidForSync
- If TRUE: call base.StartAsync
- base.StartAsync calls the overridden Start() method
- IsValidForSync is checked a second time and passes the check.
- the line is appended to the log file at MyApplication.LogFilePath
- The RoboCopy process is started
- RoboCopy process finishes
- base.StartAsync calls the GetResults() method
- results are passed from base.StartAsync, to its override, and finally to the original caller.
RoboCommand
- IRoboCommand Interface- RoboCommand
- CopyOptions
- JobOptions
- LoggingOptions
- RetryOptions
- SelectionOptions
- RoboSharpConfiguration
- JobFile
RoboQueue
- RoboQueueResults Objects
- RoboCopyResults- IResults Interface
- RoboCopyResultsList
- IRoboCopyResultsList Interface
ExitStatus Objects
- RoboCopyExitStatus- RoboCopyCombinedExitStatus
- IRoboCopyCombinedExitStatus Interface
Progress Estimator Objects
- IProgressEstimator Interface- ProgressEstimator
- RoboQueueProgressEstimator