private void map_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (IsDisposed) { return; } if (sender is ILayer && e.PropertyName == "Map") { return; // performance optimization, avoid double rendering } foreach (var tool in tools.ToArray()) { tool.OnMapPropertyChanged(sender, e); // might be a problem, events are skipped } if (Visible) { Refresh(); } else { map.Layers.ForEach(l => { if (!l.RenderRequired) { l.RenderRequired = true; } }); } }
private void map_PropertyChanged_Delayed(object sender, PropertyChangedEventArgs e) { if (IsDisposed) { return; } foreach (IMapTool tool in tools.ToArray()) { tool.OnMapPropertyChanged(sender, e); // might be a problem, events are skipped } Refresh(); }
public void ToArrayTest() { var a = new[] { new EClass(1), new EClass(2), new EClass(3) }; var l = new EventedList <EClass>(a); Assert.That(l.ToArray(), Is.EquivalentTo(a)); }
private void map_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (IsDisposed) { return; } foreach (var tool in tools.ToArray()) { tool.OnMapPropertyChanged(sender, e); // might be a problem, events are skipped } if (Visible) { Refresh(); } else { map.Layers.ForEach(l => { if (!l.RenderRequired) { l.RenderRequired = true; } }); } }