/// <summary>
 /// Builds the element maps.
 /// </summary>
 /// <param name="target">The target.</param>
 private void BuildElementMaps(Target target)
 {
     using (var session = ServiceLocator.Current.GetInstance <IDomainSessionFactoryProvider>().SessionFactory.OpenSession())
     {
         ElementMaps = new Dictionary <string, ElementMappingModel <T> >();
         var elementProps = session.Query <Element>().Where(e => e.Owner.Id == target.Id).ToList();
         //ElementMappingModel<T>.PropertyTypes.Clear();
         foreach (var elem in elementProps)
         {
             var xwalk = Crosswalks.Where(x => string.Equals(elem.Name, x.Element.Name, StringComparison.OrdinalIgnoreCase)).SelectMany(x => x.CrosswalkModels);
             var map   = new ElementMappingModel <T>(elem, xwalk);
             map.ValueInvalid   += (o, e) => Errors.Add(e.Data);
             map.ValueEvaluated += (o, e) => AddToExisting(elem.Name, e.Data);
             ElementMaps.Add(elem.Name, map);
         }
     }
 }
Example #2
0
 public IEnumerable <MarkupCrosswalk> GetLinesIsBorder(MarkupLine line) => Crosswalks.Where(c => c.IsBorder(line));
Example #3
0
 public IEnumerable <MarkupCrosswalk> GetPointCrosswalks(MarkupPoint point) => Crosswalks.Where(c => c.ContainsPoint(point));