Ejemplo n.º 1
0
        private void InitLight()
        {
            redLight = new RedLight();
            redLight.Size(50, 50);
            canLight408.Children.Add(redLight);

            redLight = new RedLight();
            redLight.Size(50, 50);
            canLight404.Children.Add(redLight);

            redLight = new RedLight();
            redLight.Size(50, 50);
            canLight402.Children.Add(redLight);

            redLight = new RedLight();
            redLight.Size(50, 50);
            canLight401.Children.Add(redLight);
        }
Ejemplo n.º 2
0
        public void DoChangeLightOnRed(int number)
        {
            if (!CheckAccess())
            {
                Dispatcher.Invoke(delegate
                {
                    switch (number)
                    {
                    case 1: redLight = new RedLight(); canLight408.Children.Clear(); redLight.Size(50, 50); canLight408.Children.Add(redLight); break;

                    case 2: redLight = new RedLight(); canLight404.Children.Clear(); redLight.Size(50, 50); canLight404.Children.Add(redLight); break;

                    case 3: redLight = new RedLight(); canLight402.Children.Clear(); redLight.Size(50, 50); canLight402.Children.Add(redLight); break;

                    case 4: redLight = new RedLight(); canLight401.Children.Clear(); redLight.Size(50, 50); canLight401.Children.Add(redLight); break;
                    }
                });
            }
        }