It's a very special time
I never even realised. w00t!
Imports System.ComponentModel
<Flags()> _
Public Enum EventTypes
ReligiousHoliday = 1
PublicHoliday = 2
Common = 4
Remarkable = 8
OnceInALifeTime = 16
CauseForCelebration = 32
End Enum
Public Interface ISpecialEvent
ReadOnly Property EventName() As String
ReadOnly Property EventType() As EventTypes
End Interface
Public Interface IThanks
Function ThanksTo() As String
Function ThanksFor() As String
End Interface
Public Class BicentennialBase
#Region " Private Members "
Protected msEventName As String
#End Region
#Region " Constructors "
Public Sub New()
msEventName = "200th Post"
End Sub
#End Region
End Class
Public Class Bicentennial
Inherits BicentennialBase
Implements ISpecialEvent
Implements IThanks
#Region " Private Members "
Private meEventType As EventTypes
Private Const csThanksFormat As String = "<a href='{0}'>{1}</a>"
#End Region
#Region " ISpecialEvent Interface "
<DefaultValue(vbNullString)> _
Public ReadOnly Property EventName() As String Implements ISpecialEvent.EventName
Get
Return msEventName
End Get
End Property
<DefaultValue(EventTypes.Common)> _
Public ReadOnly Property EventType() As EventTypes Implements ISpecialEvent.EventType
Get
Return meEventType
End Get
End Property
#End Region
#Region " IThanks Interface "
Public Function ThanksFor() As String Implements IThanks.ThanksFor
Return String.Format(csThanksFormat, "http://www.codebetter.com/blogs/sahil.malik/default.aspx", "Sahil Malik")
End Function
Public Function ThanksTo() As String Implements IThanks.ThanksTo
Return String.Format(csThanksFormat, "http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2005/05/05/62799.aspx", "The Reminder")
End Function
#End Region
#Region " Overrides "
Public Overrides Function ToString() As String
Dim oBuilder As New System.Text.StringBuilder
oBuilder.Append("Event: " & Me.EventName & vbCrLf)
oBuilder.Append("Type: " & Me.EventType.ToString & vbCrLf & vbCrLf)
oBuilder.Append("Thanks to: " & Me.ThanksTo & vbCrLf)
oBuilder.Append("Thanks for: " & Me.ThanksFor & vbCrLf)
Return oBuilder.ToString
End Function
#End Region
#Region " Constructors "
Public Sub New()
MyBase.New()
meEventType = EventTypes.Common
End Sub
Public Sub New(ByVal peEventType As EventTypes)
Me.New()
meEventType = peEventType
End Sub
#End Region
End Class
Module MainModule
Public Sub Main()
Dim oBicentennial As New Bicentennial(EventTypes.CauseForCelebration Or EventTypes.OnceInALifeTime Or EventTypes.Remarkable)
Console.Write(oBicentennial.ToString)
End Sub
End Module
Yay me :)
Listening to: sludge factory - alice in chains - (7:12)