PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/Source Code/Projection/Notice.vb

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