PageRenderTime 44ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/Source Code/Projection/Notice.vb

#
Visual Basic | 118 lines | 96 code | 22 blank | 0 comment | 0 complexity | a2f73b45c28275f24319c4d98a691d85 MD5 | raw file
  1. Public Class Notice
  2. Private FText As String = String.Empty
  3. Public Property Text() As String
  4. Get
  5. Return FText
  6. End Get
  7. Set(ByVal value As String)
  8. FText = value
  9. End Set
  10. End Property
  11. Private FSpeed As Double = 0.05
  12. Public Property Speed() As Double
  13. Get
  14. Return FSpeed
  15. End Get
  16. Set(ByVal value As Double)
  17. FSpeed = value
  18. End Set
  19. End Property
  20. Private FBackgroundColour As Color = Color.White
  21. Public Property BackgroundColour() As Color
  22. Get
  23. Return FBackgroundColour
  24. End Get
  25. Set(ByVal value As Color)
  26. FBackgroundColour = value
  27. End Set
  28. End Property
  29. Private FTextColour As Color = Color.Black
  30. Public Property TextColour() As Color
  31. Get
  32. Return FTextColour
  33. End Get
  34. Set(ByVal value As Color)
  35. FTextColour = value
  36. End Set
  37. End Property
  38. Private FStartTime As Date = Now
  39. Public Property StartTime() As Date
  40. Get
  41. Return FStartTime
  42. End Get
  43. Set(ByVal value As Date)
  44. FStartTime = value
  45. End Set
  46. End Property
  47. Private FEndTime As Date = Now.AddSeconds(30)
  48. Public Property EndTime() As Date
  49. Get
  50. Return FEndTime
  51. End Get
  52. Set(ByVal value As Date)
  53. FEndTime = value
  54. End Set
  55. End Property
  56. Public ReadOnly Property TimeLeft() As TimeSpan
  57. Get
  58. Return FEndTime.Subtract(Now)
  59. End Get
  60. End Property
  61. Public ReadOnly Property TimePassed() As TimeSpan
  62. Get
  63. Return Now.Subtract(FStartTime)
  64. End Get
  65. End Property
  66. Private FFont As Font = Nothing
  67. Public Property Font() As Font
  68. Get
  69. Return FFont
  70. End Get
  71. Set(ByVal value As Font)
  72. FFont = value
  73. End Set
  74. End Property
  75. Private FProjectingFont As Font = SystemFonts.DefaultFont
  76. Friend Property ProjectingFont() As Font
  77. Get
  78. Return FProjectingFont
  79. End Get
  80. Set(ByVal value As Font)
  81. FProjectingFont = value
  82. End Set
  83. End Property
  84. Public Sub New(ByVal text As String, _
  85. ByVal speed As Double, _
  86. ByVal lengthInSeconds As Integer, _
  87. ByVal backgroundColour As Color, _
  88. ByVal textColour As Color)
  89. FText = text
  90. FSpeed = speed
  91. FStartTime = Now
  92. FEndTime = FStartTime.AddSeconds(lengthInSeconds)
  93. FBackgroundColour = backgroundColour
  94. FTextColour = textColour
  95. End Sub
  96. End Class