From 41b950b3f3f7fa0384cccd13ed4ef38119bbcbcf Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 18 Dec 2019 15:52:25 +0200 Subject: Fixed ContinueThreadLoadingResponse. Refactored ActionLog Difference data structure to node tree. --- .../MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs index a61f14746..6c550ffda 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -95,7 +95,7 @@ namespace Tango.MachineStudio.UI TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); - TangoIOC.Default.Register(new DefaultActionLogManager() { ThrowExceptions = false }); + TangoIOC.Default.Register(); TangoIOC.Default.Register(new TeamFoundationServiceExtendedClient("https://twinetfs.visualstudio.com", String.Empty, "szzfokrceo4rhd4eqi5qpmxn3pa5iwl3q7tlqd36l2m7smz2ynoa")); -- cgit v1.3.1 From 68916b0c7e3322ff1ca8b45ed789973a23ccac51 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 18 Dec 2019 19:55:31 +0200 Subject: Improved architecture of ActionLogs. --- .../ViewModels/MainViewVM.cs | 4 +- .../Tango.MachineStudio.UI/ViewModelLocator.cs | 2 +- .../Tango.BL/ActionLogs/BasicActionLogComparer.cs | 234 --------------------- .../ActionLogs/DefaultActionLogComparer.cs | 234 +++++++++++++++++++++ .../Tango.BL/ActionLogs/DefaultActionLogManager.cs | 74 +++++-- .../Tango.BL/ActionLogs/IActionLogComparable.cs | 20 -- .../Tango.BL/ActionLogs/IActionLogComparer.cs | 23 ++ .../Tango.BL/ActionLogs/IActionLogManager.cs | 10 + .../Visual_Studio/Tango.BL/ObservableEntity.cs | 26 +-- .../Visual_Studio/Tango.BL/ObservableEntityDTO.cs | 26 +-- Software/Visual_Studio/Tango.BL/Tango.BL.csproj | 9 +- 11 files changed, 337 insertions(+), 325 deletions(-) delete mode 100644 Software/Visual_Studio/Tango.BL/ActionLogs/BasicActionLogComparer.cs create mode 100644 Software/Visual_Studio/Tango.BL/ActionLogs/DefaultActionLogComparer.cs create mode 100644 Software/Visual_Studio/Tango.BL/ActionLogs/IActionLogComparer.cs (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/ViewModels/MainViewVM.cs index 404a459d3..ae763167b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/ViewModels/MainViewVM.cs @@ -320,11 +320,13 @@ namespace Tango.MachineStudio.Catalogs.ViewModels IsFree = false; ActiveCatalog.LastUpdated = DateTime.UtcNow; await _activeCatalogContext.SaveChangesAsync(); - await LoadCatalogs(); var activeCatalogDTO = ColorCatalogDTO.FromObservable(ActiveCatalog); _actionLogManager.InsertLog(ActionLogType.CatalogSaved, _authentication.CurrentUser, ActiveCatalog.Name, _catalogBeforeSave, activeCatalogDTO, "Catalog created using Machine Studio."); _catalogBeforeSave = activeCatalogDTO; + + await LoadCatalogs(); + _notification.ShowInfo("Catalog updated successfully."); } catch (Exception ex) diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs index 6c550ffda..9539037f1 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -95,7 +95,7 @@ namespace Tango.MachineStudio.UI TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); - TangoIOC.Default.Register(); + TangoIOC.Default.Register(new DefaultActionLogManager() { IsAsync = true }); TangoIOC.Default.Register(new TeamFoundationServiceExtendedClient("https://twinetfs.visualstudio.com", String.Empty, "szzfokrceo4rhd4eqi5qpmxn3pa5iwl3q7tlqd36l2m7smz2ynoa")); diff --git a/Software/Visual_Studio/Tango.BL/ActionLogs/BasicActionLogComparer.cs b/Software/Visual_Studio/Tango.BL/ActionLogs/BasicActionLogComparer.cs deleted file mode 100644 index de07f6678..000000000 --- a/Software/Visual_Studio/Tango.BL/ActionLogs/BasicActionLogComparer.cs +++ /dev/null @@ -1,234 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.ValueObjects; - -namespace Tango.BL.ActionLogs -{ - /// - /// Represents a basic ActionLog comparison engine. - /// - public class BasicActionLogComparer - { - /// - /// Compares two instances of . - /// - /// The object before the change. - /// The object after the change. - /// - public Task Compare(IActionLogComparable before, IActionLogComparable after) - { - return Task.Factory.StartNew(() => - { - ActionLogDifference diff = new ActionLogDifference(); - diff.Name = GetComponentName(before, after); - - Compare(diff, before, after, null); - RemoveNoDifferences(diff); - - return diff; - }); - } - - #region Helpers - - private void Compare(ActionLogDifference diff, Object before, Object after, HashSet scannedObjects) - { - if (scannedObjects == null) - { - scannedObjects = new HashSet(); - } - - if (before == null && after == null) return; - - if (before != null) - { - if (scannedObjects.Contains(before)) return; - scannedObjects.Add(before); - } - - if (after != null) - { - if (scannedObjects.Contains(after)) return; - scannedObjects.Add(after); - } - - foreach (var prop in GetProperties(before, after).OrderByDescending(x => x.PropertyType.IsPrimitive || x.PropertyType.IsValueType || x.PropertyType == typeof(String))) - { - if (GetShouldIgnore(prop, before, after)) continue; - - if (prop.PropertyType.IsPrimitive || prop.PropertyType.IsValueType || prop.PropertyType == typeof(String)) - { - object beforeValue = null; - object afterValue = null; - - if (before != null) - { - beforeValue = prop.GetValue(before); - } - - if (after != null) - { - afterValue = prop.GetValue(after); - } - - if (afterValue == null && beforeValue != null) AddValueDiff(diff, prop.Name, beforeValue, afterValue); - if (afterValue != null && beforeValue == null) AddValueDiff(diff, prop.Name, beforeValue, afterValue); - - if (afterValue != null && beforeValue != null) - { - if (!afterValue.Equals(beforeValue)) - { - AddValueDiff(diff, prop.Name, beforeValue, afterValue); - } - } - } - else if (!prop.PropertyType.IsGenericType) - { - object beforePropInstance = null; - object afterPropInstance = null; - - if (before != null) - { - beforePropInstance = prop.GetValue(before); - } - - if (after != null) - { - afterPropInstance = prop.GetValue(after); - } - - Compare(AddChildDiff(diff, prop.Name), beforePropInstance, afterPropInstance, scannedObjects); - } - else - { - IList beforeCollection = null; - IList afterCollection = null; - - if (before != null) - { - beforeCollection = prop.GetValue(before) as IList; - } - - if (after != null) - { - afterCollection = prop.GetValue(after) as IList; - } - - if (beforeCollection != null && afterCollection == null) - { - for (int i = 0; i < beforeCollection.Count; i++) - { - Compare(AddChildDiff(diff, GetActionLogName(beforeCollection[i], prop.Name)), beforeCollection[i], null, scannedObjects); - } - } - else if (beforeCollection == null && afterCollection != null) - { - for (int i = 0; i < afterCollection.Count; i++) - { - Compare(AddChildDiff(diff, GetActionLogName(afterCollection[i], prop.Name)), null, afterCollection[i], scannedObjects); - } - } - - if (beforeCollection != null && afterCollection != null) - { - for (int i = 0; i < Math.Max(beforeCollection.Count, afterCollection.Count); i++) - { - var beforeItem = i < beforeCollection.Count ? beforeCollection[i] : null; - var afterItem = i < afterCollection.Count ? afterCollection[i] : null; - Compare(AddChildDiff(diff, GetActionLogName(beforeItem, prop.Name)), beforeItem, afterItem, scannedObjects); - } - } - } - } - } - - private void AddValueDiff(ActionLogDifference diff, String property, object before, object after) - { - diff.Children.Add(new ActionLogDifferenceValue() - { - Name = property, - Before = before, - After = after - }); - } - - private ActionLogDifference AddChildDiff(ActionLogDifference diff, String property) - { - ActionLogDifference childDiff = new ActionLogDifference(); - childDiff.Name = property; - diff.Children.Add(childDiff); - return childDiff; - } - - private void RemoveNoDifferences(ActionLogDifference diff) - { - foreach (var child in diff.Children.ToList()) - { - if (!child.HasDifference) - { - diff.Children.Remove(child); - } - else - { - RemoveNoDifferences(child); - } - } - } - - private String GetComponentName(Object before, Object after) - { - var afterCast = after as IActionLogComparable; - var beforeCast = before as IActionLogComparable; - - var name = afterCast != null ? afterCast.GetActionLogName() : beforeCast.GetActionLogName(); - - return name; - } - - private String GetActionLogName(Object obj, String defaultName) - { - var objCast = obj as IActionLogComparable; - if (objCast != null) - { - return objCast.GetActionLogName(); - } - else - { - return defaultName; - } - } - - private PropertyInfo GetProperty(String name, Object before, Object after) - { - return after != null ? after.GetType().GetProperty(name) : before.GetType().GetProperty(name); - } - - private List GetProperties(BindingFlags flags, Object before, Object after) - { - return after != null ? after.GetType().GetProperties(flags).ToList() : before.GetType().GetProperties(flags).ToList(); - } - - private List GetProperties(Object before, Object after) - { - return after != null ? after.GetType().GetProperties().ToList() : before.GetType().GetProperties().ToList(); - } - - private bool GetShouldIgnore(PropertyInfo prop, Object before, Object after) - { - var beforeCast = before as IActionLogComparable; - var afterCast = after as IActionLogComparable; - - if (beforeCast != null) return beforeCast.ShouldActionLogIgnore(prop.Name); - if (afterCast != null) return afterCast.ShouldActionLogIgnore(prop.Name); - - return false; - } - - #endregion - } -} diff --git a/Software/Visual_Studio/Tango.BL/ActionLogs/DefaultActionLogComparer.cs b/Software/Visual_Studio/Tango.BL/ActionLogs/DefaultActionLogComparer.cs new file mode 100644 index 000000000..542aba0e4 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/ActionLogs/DefaultActionLogComparer.cs @@ -0,0 +1,234 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.ValueObjects; + +namespace Tango.BL.ActionLogs +{ + /// + /// Represents the default implementation of . + /// + public class DefaultActionLogComparer : IActionLogComparer + { + /// + /// Compares the specified object before and after changes and returns the difference tree. + /// + /// The object before the change. + /// The object after the change. + /// + public Task Compare(IActionLogComparable before, IActionLogComparable after) + { + return Task.Factory.StartNew(() => + { + ActionLogDifference diff = new ActionLogDifference(); + diff.Name = GetComponentName(before, after); + + Compare(diff, before, after, null); + RemoveNoDifferences(diff); + + return diff; + }); + } + + #region Helpers + + private void Compare(ActionLogDifference diff, Object before, Object after, HashSet scannedObjects) + { + if (scannedObjects == null) + { + scannedObjects = new HashSet(); + } + + if (before == null && after == null) return; + + if (before != null) + { + if (scannedObjects.Contains(before)) return; + scannedObjects.Add(before); + } + + if (after != null) + { + if (scannedObjects.Contains(after)) return; + scannedObjects.Add(after); + } + + foreach (var prop in GetProperties(before, after).OrderByDescending(x => x.PropertyType.IsPrimitive || x.PropertyType.IsValueType || x.PropertyType == typeof(String))) + { + if (GetShouldIgnore(prop, before, after)) continue; + + if (prop.PropertyType.IsPrimitive || prop.PropertyType.IsValueType || prop.PropertyType == typeof(String)) + { + object beforeValue = null; + object afterValue = null; + + if (before != null) + { + beforeValue = prop.GetValue(before); + } + + if (after != null) + { + afterValue = prop.GetValue(after); + } + + if (afterValue == null && beforeValue != null) AddValueDiff(diff, prop.Name, beforeValue, afterValue); + if (afterValue != null && beforeValue == null) AddValueDiff(diff, prop.Name, beforeValue, afterValue); + + if (afterValue != null && beforeValue != null) + { + if (!afterValue.Equals(beforeValue)) + { + AddValueDiff(diff, prop.Name, beforeValue, afterValue); + } + } + } + else if (!prop.PropertyType.IsGenericType) + { + object beforePropInstance = null; + object afterPropInstance = null; + + if (before != null) + { + beforePropInstance = prop.GetValue(before); + } + + if (after != null) + { + afterPropInstance = prop.GetValue(after); + } + + Compare(AddChildDiff(diff, prop.Name), beforePropInstance, afterPropInstance, scannedObjects); + } + else + { + IList beforeCollection = null; + IList afterCollection = null; + + if (before != null) + { + beforeCollection = prop.GetValue(before) as IList; + } + + if (after != null) + { + afterCollection = prop.GetValue(after) as IList; + } + + if (beforeCollection != null && afterCollection == null) + { + for (int i = 0; i < beforeCollection.Count; i++) + { + Compare(AddChildDiff(diff, GetActionLogName(beforeCollection[i], prop.Name)), beforeCollection[i], null, scannedObjects); + } + } + else if (beforeCollection == null && afterCollection != null) + { + for (int i = 0; i < afterCollection.Count; i++) + { + Compare(AddChildDiff(diff, GetActionLogName(afterCollection[i], prop.Name)), null, afterCollection[i], scannedObjects); + } + } + + if (beforeCollection != null && afterCollection != null) + { + for (int i = 0; i < Math.Max(beforeCollection.Count, afterCollection.Count); i++) + { + var beforeItem = i < beforeCollection.Count ? beforeCollection[i] : null; + var afterItem = i < afterCollection.Count ? afterCollection[i] : null; + Compare(AddChildDiff(diff, GetActionLogName(beforeItem, prop.Name)), beforeItem, afterItem, scannedObjects); + } + } + } + } + } + + private void AddValueDiff(ActionLogDifference diff, String property, object before, object after) + { + diff.Children.Add(new ActionLogDifferenceValue() + { + Name = property, + Before = before, + After = after + }); + } + + private ActionLogDifference AddChildDiff(ActionLogDifference diff, String property) + { + ActionLogDifference childDiff = new ActionLogDifference(); + childDiff.Name = property; + diff.Children.Add(childDiff); + return childDiff; + } + + private void RemoveNoDifferences(ActionLogDifference diff) + { + foreach (var child in diff.Children.ToList()) + { + if (!child.HasDifference) + { + diff.Children.Remove(child); + } + else + { + RemoveNoDifferences(child); + } + } + } + + private String GetComponentName(Object before, Object after) + { + var afterCast = after as IActionLogComparable; + var beforeCast = before as IActionLogComparable; + + var name = afterCast != null ? afterCast.GetActionLogName() : beforeCast.GetActionLogName(); + + return name; + } + + private String GetActionLogName(Object obj, String defaultName) + { + var objCast = obj as IActionLogComparable; + if (objCast != null) + { + return objCast.GetActionLogName(); + } + else + { + return defaultName; + } + } + + private PropertyInfo GetProperty(String name, Object before, Object after) + { + return after != null ? after.GetType().GetProperty(name) : before.GetType().GetProperty(name); + } + + private List GetProperties(BindingFlags flags, Object before, Object after) + { + return after != null ? after.GetType().GetProperties(flags).ToList() : before.GetType().GetProperties(flags).ToList(); + } + + private List GetProperties(Object before, Object after) + { + return after != null ? after.GetType().GetProperties().ToList() : before.GetType().GetProperties().ToList(); + } + + private bool GetShouldIgnore(PropertyInfo prop, Object before, Object after) + { + var beforeCast = before as IActionLogComparable; + var afterCast = after as IActionLogComparable; + + if (beforeCast != null) return beforeCast.ShouldActionLogIgnore(prop.Name); + if (afterCast != null) return afterCast.ShouldActionLogIgnore(prop.Name); + + return false; + } + + #endregion + } +} diff --git a/Software/Visual_Studio/Tango.BL/ActionLogs/DefaultActionLogManager.cs b/Software/Visual_Studio/Tango.BL/ActionLogs/DefaultActionLogManager.cs index 9ffdcbc22..d95f4cd54 100644 --- a/Software/Visual_Studio/Tango.BL/ActionLogs/DefaultActionLogManager.cs +++ b/Software/Visual_Studio/Tango.BL/ActionLogs/DefaultActionLogManager.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Tango.BL.Entities; using Tango.BL.Enumerations; @@ -19,6 +20,25 @@ namespace Tango.BL.ActionLogs /// public class DefaultActionLogManager : ExtendedObject, IActionLogManager { + /// + /// Gets or sets the action log comparer used to compare related objects. + /// + public IActionLogComparer ActionLogComparer { get; set; } + + /// + /// Gets or sets a value indicating whether to perform the logging operations asynchronously. + /// + public bool IsAsync { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public DefaultActionLogManager() + { + IsAsync = true; + ActionLogComparer = new DefaultActionLogComparer(); + } + /// /// Inserts a new action log (main entry point). /// @@ -30,7 +50,7 @@ namespace Tango.BL.ActionLogs /// The message. public void InsertLog(ActionLogType type, string userGuid, string relatedObjectName, string relatedObjectGuid, ActionLogDifference difference, string message = null) { - Task.Factory.StartNew(() => + Task task = new Task(() => { using (ObservablesContext db = ObservablesContext.CreateDefault()) { @@ -62,6 +82,15 @@ namespace Tango.BL.ActionLogs } } }); + + if (IsAsync) + { + task.Start(); + } + else + { + task.RunSynchronously(); + } } /// @@ -75,28 +104,45 @@ namespace Tango.BL.ActionLogs /// The message. public void InsertLog(ActionLogType type, string userGuid, string relatedObjectName, IActionLogComparable relatedObjectBefore, IActionLogComparable relatedObjectAfter, string message = null) { - Task.Factory.StartNew(() => + Task task = new Task(() => { - ActionLogDifference diff = null; + ActionLogDifference diff = new ActionLogDifference(); - try + if (ActionLogComparer != null) { - diff = new BasicActionLogComparer().Compare(relatedObjectBefore, relatedObjectAfter).Result; - } - catch (Exception ex) - { - LogManager.Log(ex, $"Error while comparing for action log '{type}'."); - } + try + { + diff = ActionLogComparer.Compare(relatedObjectBefore, relatedObjectAfter).Result; + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error while comparing for action log '{type}'."); + } - if (diff.Children.Count > 0) - { - InsertLog(type, userGuid, relatedObjectName, GetRelatedObjectGuid(relatedObjectBefore, relatedObjectAfter), diff, message); + if (diff.Children.Count > 0) + { + InsertLog(type, userGuid, relatedObjectName, GetRelatedObjectGuid(relatedObjectBefore, relatedObjectAfter), diff, message); + } + else + { + LogManager.Log($"Action log '{type}' was about to be inserted but skipped due to no differences."); + } } else { - LogManager.Log($"Action log '{type}' was about to be inserted but skipped due to no differences."); + Debug.WriteLine("No comparer defined for action log."); + InsertLog(type, userGuid, relatedObjectName, GetRelatedObjectGuid(relatedObjectBefore, relatedObjectAfter), diff, message); } }); + + if (IsAsync) + { + task.Start(); + } + else + { + task.RunSynchronously(); + } } /// diff --git a/Software/Visual_Studio/Tango.BL/ActionLogs/IActionLogComparable.cs b/Software/Visual_Studio/Tango.BL/ActionLogs/IActionLogComparable.cs index b9416635f..255f5a407 100644 --- a/Software/Visual_Studio/Tango.BL/ActionLogs/IActionLogComparable.cs +++ b/Software/Visual_Studio/Tango.BL/ActionLogs/IActionLogComparable.cs @@ -17,13 +17,6 @@ namespace Tango.BL.ActionLogs /// String Guid { get; } - /// - /// Compares this instance to another ActionLog comparable instance. - /// - /// The before. - /// A tree of differences. - Task CompareTo(IActionLogComparable before); - /// /// Returns true if the specified property should be ignored during ActionLog comparison. /// @@ -37,17 +30,4 @@ namespace Tango.BL.ActionLogs /// String GetActionLogName(); } - - /// - /// Represents a type which is supported for ActionLog difference comparison. - /// - public interface IActionLogComparable : IActionLogComparable where T : class - { - /// - /// Compares this instance to another ActionLog comparable instance. - /// - /// The before. - /// A tree of differences. - Task CompareTo(T before); - } } diff --git a/Software/Visual_Studio/Tango.BL/ActionLogs/IActionLogComparer.cs b/Software/Visual_Studio/Tango.BL/ActionLogs/IActionLogComparer.cs new file mode 100644 index 000000000..94db259b0 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/ActionLogs/IActionLogComparer.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.ValueObjects; + +namespace Tango.BL.ActionLogs +{ + /// + /// Represents an comparer. + /// + public interface IActionLogComparer + { + /// + /// Compares the specified object before and after changes and returns the difference tree. + /// + /// The object before the change. + /// The object after the change. + /// + Task Compare(IActionLogComparable before, IActionLogComparable after); + } +} diff --git a/Software/Visual_Studio/Tango.BL/ActionLogs/IActionLogManager.cs b/Software/Visual_Studio/Tango.BL/ActionLogs/IActionLogManager.cs index 150116c97..6fdca98a7 100644 --- a/Software/Visual_Studio/Tango.BL/ActionLogs/IActionLogManager.cs +++ b/Software/Visual_Studio/Tango.BL/ActionLogs/IActionLogManager.cs @@ -14,6 +14,16 @@ namespace Tango.BL.ActionLogs /// public interface IActionLogManager { + /// + /// Gets or sets the action log comparer used to compare related objects. + /// + IActionLogComparer ActionLogComparer { get; set; } + + /// + /// Gets or sets a value indicating whether to perform the logging operations asynchronously. + /// + bool IsAsync { get; set; } + /// /// Inserts a new action log (main entry point). /// diff --git a/Software/Visual_Studio/Tango.BL/ObservableEntity.cs b/Software/Visual_Studio/Tango.BL/ObservableEntity.cs index 211450614..e3bba77bd 100644 --- a/Software/Visual_Studio/Tango.BL/ObservableEntity.cs +++ b/Software/Visual_Studio/Tango.BL/ObservableEntity.cs @@ -52,7 +52,7 @@ namespace Tango.BL /// /// [Serializable] - public abstract class ObservableEntity : ExtendedObject, IObservableEntity, IActionLogComparable where T : class, IObservableEntity + public abstract class ObservableEntity : ExtendedObject, IObservableEntity, IActionLogComparable where T : class, IObservableEntity { #region Events @@ -663,30 +663,6 @@ namespace Tango.BL #region Action Log - /// - /// Compares this instance to another ActionLog comparable instance. - /// - /// The before. - /// - /// A tree of differences. - /// - public Task CompareTo(T before) - { - return new BasicActionLogComparer().Compare(before as IActionLogComparable, this); - } - - /// - /// Compares this instance to another ActionLog comparable instance. - /// - /// The before. - /// - /// A tree of differences. - /// - Task IActionLogComparable.CompareTo(IActionLogComparable before) - { - return CompareTo(before as T); - } - /// /// Returns true if the specified property should be ignored during ActionLog comparison. /// diff --git a/Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs b/Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs index 15ba1b24e..720d6b9b7 100644 --- a/Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs +++ b/Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs @@ -18,7 +18,7 @@ namespace Tango.BL /// /// /// - public abstract class ObservableEntityDTO : IObservableEntityDTO, IEquatable, IActionLogComparable where T : IObservableEntity where DTO : ObservableEntityDTO + public abstract class ObservableEntityDTO : IObservableEntityDTO, IEquatable, IActionLogComparable where T : IObservableEntity where DTO : ObservableEntityDTO { /// /// Gets or sets the ID of the entity. @@ -250,30 +250,6 @@ namespace Tango.BL return EqualsToObservable(observable); } - /// - /// Compares this instance to another ActionLog comparable instance. - /// - /// The before. - /// - /// A tree of differences. - /// - public Task CompareTo(DTO before) - { - return new BasicActionLogComparer().Compare(before, this); - } - - /// - /// Compares this instance to another ActionLog comparable instance. - /// - /// The before. - /// - /// A tree of differences. - /// - Task IActionLogComparable.CompareTo(IActionLogComparable before) - { - return CompareTo(before as DTO); - } - /// /// Returns true if the specified property should be ignored during ActionLog comparison. /// diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj index 2f9cf489e..f1bdf94ec 100644 --- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj +++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj @@ -84,9 +84,10 @@ GlobalVersionInfo.cs - + + @@ -578,9 +579,7 @@ Tango.Settings - - - + @@ -591,7 +590,7 @@ - + \ No newline at end of file -- cgit v1.3.1