PageRenderTime 44ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/NerdSharp.Net_Studio/NerdSharp_UberNet/Science/Comp_Sci/StudioComponents/Widgets/OtherControls/LED.xaml.cs

https://bitbucket.org/pastageek/scide-cad-scilife
C# | 48 lines | 41 code | 4 blank | 3 comment | 2 complexity | 68210f0d0049c1e33da2966189de073f MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Data;
  8. using System.Windows.Documents;
  9. using System.Windows.Input;
  10. using System.Windows.Media;
  11. using System.Windows.Media.Imaging;
  12. using System.Windows.Navigation;
  13. using System.Windows.Shapes;
  14. namespace NerdSharp.Net_Studio.NerdSharp_UberNet.Science.Comp_Sci.StudioComponents.Widgets.OtherControls
  15. {
  16. /// <summary>
  17. /// Interaction logic for LED.xaml
  18. /// </summary>
  19. public partial class LED : UserControl
  20. {
  21. public LED()
  22. {
  23. InitializeComponent();
  24. }
  25. public enum State { ON, OFF }
  26. private State zeroOne = new State();
  27. public State ZeroOne
  28. {
  29. get { return zeroOne; }
  30. set
  31. {
  32. zeroOne = value;
  33. if (value == State.ON)
  34. {
  35. mainColor.Color = Colors.Green;
  36. }
  37. else
  38. {
  39. mainColor.Color = Colors.Red;
  40. }
  41. }
  42. }
  43. }
  44. }