using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; namespace InABox.Core { public static class LinkedProperties { private static readonly List _LinkedProperties = new List(); public static void Register(Expression> path, Expression> source, Expression> target) { var map = new LinkedProperty(path, source, target); if (!_LinkedProperties.Any(x => x.Equals(map))) _LinkedProperties.Add(map); } public static IEnumerable Find(object parent, object path) { return _LinkedProperties.Where(x => (x.Type == parent.GetType()) && (CoreUtils.GetPropertyValue(parent,x.Path) == path)); } } }