I am creating a library to validate the Fiscal SPED in VB.NET and to speed up the process of creating the lines, each class already has its predefined attributes and in the order according to the documentation, as in the example below: p>
' REGISTRO 0001: ABERTURA DO BLOCO 0
Public Class Registro0001
' Texto fixo contendo “0001”.
Public Shared reg As String = "0001"
' Indicador de movimento:
' 0- Bloco com dados informados;
' 1- Bloco sem dados informados.
Public indMov As String = ""
' construtor
Public Sub New(_reg As String, _indMov As String)
reg = _reg
indMov = _indMov
End Sub
Public Overrides Function ToString() As String
Return $"|{reg}|{indMov}|"
End Function
End Class
Is there any way I can get all the properties that exist within the class in the order they were declared and use the content instantiated in them within my ToString()
? method
I was thinking of something it > but I can not understand how.