aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Synchronization/Diff.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2017-11-27 21:51:38 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2017-11-27 21:51:38 +0200
commitdf2f9b27b12356d6e92c64a72049f0fc4e6b86c0 (patch)
tree049ced63087ef30986cc998f8546071e5894e37e /Software/Visual_Studio/Tango.Synchronization/Diff.cs
parent7060dc80c707fc0441ff69fe4f899107cb3f6fc1 (diff)
downloadTango-df2f9b27b12356d6e92c64a72049f0fc4e6b86c0.tar.gz
Tango-df2f9b27b12356d6e92c64a72049f0fc4e6b86c0.zip
Started Remote <=> Local Synchronization... /;
Diffstat (limited to 'Software/Visual_Studio/Tango.Synchronization/Diff.cs')
-rw-r--r--Software/Visual_Studio/Tango.Synchronization/Diff.cs65
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;
+ }
+ }
+}