diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Synchronization/Diff.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Synchronization/Diff.cs | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Synchronization/Diff.cs b/Software/Visual_Studio/Tango.Synchronization/Diff.cs new file mode 100644 index 000000000..45bd1581c --- /dev/null +++ b/Software/Visual_Studio/Tango.Synchronization/Diff.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Synchronization +{ + /// <summary> + /// Represents an <see cref="LocalDBComparer.Compare"/> result. + /// </summary> + public class Diff + { + private Action _action; + + /// <summary> + /// Gets the difference action. + /// </summary> + public DiffAction Action { get; private set; } + + /// <summary> + /// Gets the difference description. + /// </summary> + public String Description { get; private set; } + + /// <summary> + /// Gets the <see cref="Commit"/> command. + /// </summary> + public String Command { get; private set; } + + /// <summary> + /// Initializes a new instance of the <see cref="Diff"/> class. + /// </summary> + /// <param name="dataBaseAction">The data base action.</param> + /// <param name="description">The description.</param> + /// <param name="action">The action.</param> + /// <param name="command">The command.</param> + public Diff(DiffAction dataBaseAction, String description, Action action, String command) + { + Action = dataBaseAction; + Description = description; + _action = action; + Command = command; + } + + /// <summary> + /// Commits the difference to the target DB. + /// </summary> + public void Commit() + { + _action(); + } + + /// <summary> + /// Returns a <see cref="System.String" /> that represents this instance. + /// </summary> + /// <returns> + /// A <see cref="System.String" /> that represents this instance. + /// </returns> + public override string ToString() + { + return Command; + } + } +} |
