mpappert Posted December 8, 2002 Posted December 8, 2002 Hey Everyone, I've 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: Public Enum LogEntry dbOpen = 1 dbClosed = 2 End Enum SomeArray(LogEntry.dbOpen) = "Database Connection Open" I can think of a few methods for accomplishing this, and wondering if there is a standard practice for accomplishing this or whether it's 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: LogWriteText(colLogEntries(LogEntry.dbOpen)) 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. Quote
Moderators Robby Posted December 8, 2002 Moderators Posted December 8, 2002 I would use method 1, but let's wait for a few of our resident gurus to weigh-in. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.