C#C
C#4y ago
Rhythmic

❔ Making properties accessible by both static and non-static methods

I had to make a static duplicate of a property, because I wanted it to be accessible by both non-static and static methods:
readonly string[] NoteNames = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" }; static readonly string[] NoteNamesStatic = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
Is there a better way of doing this, or do I always need to define it twice?
Was this page helpful?