Replace WriteLog with the following:
P.S. I was just browsing through a list of projects in VB.NET on codeplex, then browsing through your code for fun.
Public Sub WriteLog(ByVal _source As String, ByVal _log_str As String, Optional ByVal _log_type As LogType = LogType.Info)
Dim logTypeString As String = GetLogTypeString(_log_type)
Dim msg As String = String.Format("[{0}] [{1}] {2}", logTypeString, _source, _log_str)
_var_log.AppendLine(msg)
Debug.WriteLine(msg)
RaiseEvent LogChanged(_var_log.ToString)
End Sub
Private Function GetLogTypeString(_log_type As LogType) As String
Select Case _log_type
Case LogType.Info : Return "INFO"
Case LogType.Fehler : Return "FEHLER"
Case LogType.Warnung : Return "WARNUNG"
Case Else : Throw New NotImplementedException
End Select
End Function
"IF DEBUG" is not necessary, it will automatically work like that:P.S. I was just browsing through a list of projects in VB.NET on codeplex, then browsing through your code for fun.