C# - Creating a code file with common definitions/constants/enums etc? -


In C ++ I will often create a code file that includes constants, enums, #defined -s, macros etc.

What is the best practice for that in C #? Can I create a stable class and fill it with that data? Or is there any other way?

Yes, you need a class for constants (and a static class would be enough), but I will have many classes - one intent

In C #, any # Define only applies to that file, so there is not enough for them to be a class (by putting them) instead the project In Jana / build-script) and the macro does not exist.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -