public void RecalculateBatches() { var dashes = new List <MarkupStyleDash>(); dashes.AddRange(Lines.SelectMany(l => l.Dashes)); dashes.AddRange(Fillers.SelectMany(f => f.Dashes)); dashes.AddRange(Crosswalks.SelectMany(c => c.Dashes)); RenderBatches = RenderBatch.FromDashes(dashes).ToArray(); }
/// <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); } } }
public IEnumerable <MarkupCrosswalk> GetLinesIsBorder(MarkupLine line) => Crosswalks.Where(c => c.IsBorder(line));
public IEnumerable <MarkupCrosswalk> GetPointCrosswalks(MarkupPoint point) => Crosswalks.Where(c => c.ContainsPoint(point));