I have mainly a C++ background and I am learning C#. So, I need some help with C# idioms and style.
I am trying to write, in C#, a small text-file parsing method i
I know this is old, so this is mainly for folks looking for ideas.
The closest I can think of to creating an 'enum' type, clean structure as required, within a method is to use a dictionary.
var stateOpt = new Dictionary() { { "stHeader", 0 }, { "stBody", 1 }, { "stFooter", 2 } };
var state = stateOpt["stBody"];
You can then do what you need in your condition...
if (state == stateOpt["stHeader"] && input == ".endheader")
{
state = stateOpt["stBody"];
}