Artemis.Profiles.Layers.Types.Audio.AudioType.Draw C# (CSharp) Method

Draw() public method

public Draw ( LayerModel layer, System.Windows.Media.DrawingContext c ) : void
layer LayerModel
c System.Windows.Media.DrawingContext
return void
        public void Draw(LayerModel layer, DrawingContext c)
        {
            lock (SpectrumData)
            {
                foreach (var audioLayer in _audioLayers)
                {
                    // This is cheating but it ensures that the brush is drawn across the entire main-layer
                    var oldWidth = audioLayer.Properties.Width;
                    var oldHeight = audioLayer.Properties.Height;
                    var oldX = audioLayer.Properties.X;
                    var oldY = audioLayer.Properties.Y;

                    audioLayer.Properties.Width = layer.Properties.Width;
                    audioLayer.Properties.Height = layer.Properties.Height;
                    audioLayer.Properties.X = layer.Properties.X;
                    audioLayer.Properties.Y = layer.Properties.Y;
                    audioLayer.LayerType.Draw(audioLayer, c);

                    audioLayer.Properties.Width = oldWidth;
                    audioLayer.Properties.Height = oldHeight;
                    audioLayer.Properties.X = oldX;
                    audioLayer.Properties.Y = oldY;
                }
            }
        }