Esempio n. 1
0
        private void OnLayerRemoved(Layer layer)
        {
            if (LayerRemoved != null) LayerRemoved(this, new LayerEventArgs(layer));

            try
            {
                layer.UpdateOrderChanged -= layer_UpdateOrderChanged;
            }
            catch (Exception) { }
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
 public void AddLayer(Layer layer)
 {
     if (!Layers.Contains(layer))
     {
         Layers.Add(layer);
         OnLayerAdded(layer);
     }
 }
Esempio n. 4
0
 public void RemoveLayer(Layer layer)
 {
     if (Layers.Contains(layer))
     {
         Layers.Remove(layer);
         OnLayerRemoved(layer);
     }
 }
Esempio n. 5
0
        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;
        }