private void Initialize(StreamingContext context)
 {
     _layerInvalidated         = true;
     _groupLayer               = new GroupLayer();
     _groupLayer.LayerChanged += Group_LayerChanged;
     Lights = new ObservableCollection <Light>();
 }
Ejemplo n.º 2
0
        private void AddLayer_Click(object sender, RoutedEventArgs e)
        {
            GroupLayer layer = Layer as GroupLayer;

            ColorLayer colorLayer = new ColorLayer();

            layer.AddLayer(colorLayer);
        }
Ejemplo n.º 3
0
        public void Initialize(Layer oldLayer)
        {
            Description  = oldLayer.Description;
            _group       = oldLayer.GroupLayer;
            LayerChanged = oldLayer.LayerChanged;

            foreach (Effect effect in oldLayer.Effects)
            {
                AddEffect(effect);
            }
        }
Ejemplo n.º 4
0
        private void LayerType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ColorPanel.Visibility    = Visibility.Collapsed;
            ImagePanel.Visibility    = Visibility.Collapsed;
            LightingPanel.Visibility = Visibility.Collapsed;

            ComboBoxItem item      = LayerTypeCombo.SelectedItem as ComboBoxItem;
            LayerType    layerType = (LayerType)item.Tag;

            if (Layer.LayerType != layerType)
            {
                Layer layer = null;
                switch (layerType)
                {
                case LayerType.Backdrop:
                {
                    layer = new BackdropLayer();
                }
                break;

                case LayerType.BackdropHost:
                {
                    layer = new BackdropHostLayer();
                }
                break;

                case LayerType.Color:
                {
                    layer = new ColorLayer();
                }
                break;

                case LayerType.Image:
                {
                    layer = new ImageLayer();
                }
                break;

                case LayerType.Lighting:
                {
                    layer = new LightingLayer();
                }
                break;

                case LayerType.Group:
                {
                    layer = new GroupLayer();
                }
                break;

                default:
                    Debug.Assert(false);
                    break;
                }

                // Set the new layer
                Layer.GroupLayer.ReplaceLayer(Layer, layer);

                Layer = layer;

                // Update the edit control UI
                UpdateUI();
            }
        }