using RoboSharp.Interfaces;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RoboSharp
{
///
/// Object that provides methods to generate new objects.
///
public class RoboCommandFactory : IRoboCommandFactory
{
///
/// Create a new object using default settings.
///
///
/// This method is used by the other methods within the to generate the inital object that will be returned.
///
All settings are then applied to the object's options components (such as the source/destination parameters)
///
As such, overriding this one method will to provide will provide the other factory methods with the customized default IRobocommand object.
///
/// new object using the parameterless constructor
public virtual IRoboCommand GetRoboCommand() => new RoboCommand();
///
/// Create a new object with the specified and .
///
///
///
///
/// new object with the specified and .
///
public virtual IRoboCommand GetRoboCommand(string source, string destination)
{
var cmd = GetRoboCommand();
cmd.CopyOptions.Source = source;
cmd.CopyOptions.Destination = destination;
return cmd;
}
///
/// Create a new object with the specified options
///
///
/// The options to apply to the generated object
/// The options to apply to the generated object
/// ]
///
public virtual IRoboCommand GetRoboCommand(string source, string destination, CopyOptions.CopyActionFlags copyActionFlags, SelectionOptions.SelectionFlags selectionFlags)
{
var cmd = GetRoboCommand(source, destination);
cmd.CopyOptions.ApplyActionFlags(copyActionFlags);
cmd.SelectionOptions.ApplySelectionFlags(selectionFlags);
return cmd;
}
///
public virtual IRoboCommand GetRoboCommand(string source, string destination, CopyOptions.CopyActionFlags copyActionFlags)
{
return GetRoboCommand(source, destination, copyActionFlags, SelectionOptions.SelectionFlags.Default);
}
}
}