/// <summary> /// /// </summary> /// <param name="gfx"></param> /// <param name="layer"></param> /// <param name="db"></param> /// <param name="r"></param> public void Draw(object gfx, Layer layer, ImmutableArray<ShapeProperty> db, Record r) { foreach (var shape in layer.Shapes) { if (shape.State.HasFlag(_state.DrawShapeState)) { shape.Draw(gfx, this, 0, 0, db, r); } } }
/// <summary> /// /// </summary> /// <param name="layer"></param> public void Add(Layer layer) { if (layer == null) return; layer.PropertyChanged += LayerObserver; Verbose("Add Layer: " + layer.Name); if (layer.Shapes != null) { Add(layer.Shapes); } }
/// <summary> /// /// </summary> private void Initialize() { if (_layer != null) { DeInitialize(); } var layer = DataContext as Layer; if (layer != null) { _layer = layer; _layer.InvalidateLayer += Invalidate; } }
/// <summary> /// /// </summary> /// <param name="layer"></param> public void Remove(Layer layer) { if (layer == null) return; layer.PropertyChanged -= LayerObserver; Verbose("Remove Layer: " + layer.Name); if (layer.Shapes != null) { Remove(layer.Shapes); } }
/// <summary> /// /// </summary> private void DeInitialize() { if (_layer != null) { _layer.InvalidateLayer -= Invalidate; _layer = default(Layer); } }