Imports Microsoft.VisualBasic
Imports System.Xml


Public Class ErrorLog
	Private _err As String
	Private _date As String
	Private _innerError As String
	Public Sub New()
		MyBase.New()
    End Sub

	Public Sub New(ByVal xml As String)

		Dim xmldoc As XmlDocument = New XmlDocument
		'Dim xmlDoc As XmlDocument
		xmldoc.LoadXml(xml)
		Dim _parts() As String = xmldoc.DocumentElement.InnerText.Split("|")
		If _parts.Length >= 1 Then
			Me._err = _parts(0)
		Else
			Me._err = "No error data"
		End If

		If (_parts.Length >= 2) Then
			Me._date = _parts(1)
		Else
			Me._date = Date.Now()
		End If

		If _parts.Length >= 3 Then
			Me._innerError = _parts(2)
		Else
			Me._innerError = "No inner error"
		End If

	End Sub

    Public Overrides Function ToString() As String
        Dim _xml As String = String.Format("{0}|{1}|{2}", _err, _date, _innerError)
        Return _xml
    End Function


	Public Property Err() As String

		Get
			Return _err
		End Get
		Set(ByVal value As String)
			_err = value
		End Set
	End Property

    Public Property ErrorDate() As String
        Get
            Return _date
        End Get
        Set(ByVal value As String)
            _date = value
        End Set
    End Property

	Public Property InnerError() As String
		Get
			Return _innerError
		End Get
		Set(ByVal value As String)

			_innerError = value

		End Set
    End Property




End Class
