private void OnLayerRemoved(Layer layer) { if (LayerRemoved != null) LayerRemoved(this, new LayerEventArgs(layer)); try { layer.UpdateOrderChanged -= layer_UpdateOrderChanged; } catch (Exception) { } }
private void OnLayerAdded(Layer layer) { if (LayerAdded != null) LayerAdded(this, new LayerEventArgs(layer)); // hook up events layer.UpdateOrderChanged += layer_UpdateOrderChanged; // refresh the update order SortUpdateOrder(); }
public void AddLayer(Layer layer) { if (!Layers.Contains(layer)) { Layers.Add(layer); OnLayerAdded(layer); } }
public void RemoveLayer(Layer layer) { if (Layers.Contains(layer)) { Layers.Remove(layer); OnLayerRemoved(layer); } }
protected virtual void OnLayerChanged(Layer layer) { if (LayerChanged != null) LayerChanged(this, new LayerEventArgs(layer)); if (layer != null) foreach (WorldObject wo in _components) wo.Layer = layer; }