Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            DigitalClock digitalClock = new DigitalClock();

            Console.WriteLine(digitalClock.DigitalClockInfo());

            FlipClock flipClock = new FlipClock();

            Console.WriteLine(flipClock.FlipClockInfo());

            QuartzClock quartzClock = new QuartzClock();

            Console.WriteLine(quartzClock.QuartzClockInfo());
        }
 private void Light_Click(object sender, EventArgs e)
 {
     if (null != _dark)
     {
         _dark.Close();
         _dark = null;
     }
     if (null == _light)
     {
         this.Visibility = Visibility.Collapsed;
         _light = new QuartzClock();
         _light.Show();
         _light.Activate();
     }
     else
     {
         _light.Show();
         _light.Activate();
     }
  
 }
 private void item1_Click(object sender, EventArgs e)
 {
     if (null != _dark)
     {
         _dark.Close();
         _dark = null;
     }
     if (null != _light)
     {
         _light.Close();
         _light = null;
     }
     this.Visibility = Visibility.Visible;
     this.Activate();
 }
 private void Dark_Click(object sender, EventArgs e)
 {
     if (null != _light)
     {
         _light.Close();
         _light = null;
     }
     if (null == _dark)
     {
         this.Visibility = Visibility.Collapsed;
         _dark = new ElectronicCock();
         _dark.Show();
         _dark.Activate();
     }
     else
     {
         _dark.Show();
         _dark.Activate();
     }
 }