mpappert
Well-known member
Hey Everyone,
Ive created a logEntry Class and I want to be able to support standardized logEntries. I want an enum that will relate to an array or (preferably) a resource file. For example:
[VB]
Public Enum LogEntry
dbOpen = 1
dbClosed = 2
End Enum
SomeArray(LogEntry.dbOpen) = "Database Connection Open"
[/VB]
I can think of a few methods for accomplishing this, and wondering if there is a standard practice for accomplishing this or whether its personal preference ...
Method 1:
Create the Enum as per above, and in the LogWriteText function, use a select statement to check a property that the user could set to use a default LogEntry, and write the appropriate line to the logfile and then reset the property to 0.
Method 2:
Create a collection that the user could use when calling the LogWriteText Function as follows:
[VB]
LogWriteText(colLogEntries(LogEntry.dbOpen))
[/VB]
This method would require a heavy initialization as I would have to cycle through the creation of the collection everytime an instance is created .. seems like overkill ...
Method 3:
Use a resource file (not sure how to do this one in VB.NET)
Thanks for your help!
M.
Ive created a logEntry Class and I want to be able to support standardized logEntries. I want an enum that will relate to an array or (preferably) a resource file. For example:
[VB]
Public Enum LogEntry
dbOpen = 1
dbClosed = 2
End Enum
SomeArray(LogEntry.dbOpen) = "Database Connection Open"
[/VB]
I can think of a few methods for accomplishing this, and wondering if there is a standard practice for accomplishing this or whether its personal preference ...
Method 1:
Create the Enum as per above, and in the LogWriteText function, use a select statement to check a property that the user could set to use a default LogEntry, and write the appropriate line to the logfile and then reset the property to 0.
Method 2:
Create a collection that the user could use when calling the LogWriteText Function as follows:
[VB]
LogWriteText(colLogEntries(LogEntry.dbOpen))
[/VB]
This method would require a heavy initialization as I would have to cycle through the creation of the collection everytime an instance is created .. seems like overkill ...
Method 3:
Use a resource file (not sure how to do this one in VB.NET)
Thanks for your help!
M.