public static void Initialize() { OctaveList.Add(item: new Octave() { Current = 0, Name = "1" }); OctaveList.Add(item: new Octave() { Current = 1, Name = "2" }); OctaveList.Add(item: new Octave() { Current = 2, Name = "3" }); Octave = OctaveList[0]; }
private static Octave ChangeOctave(string octave) { var o = (from a in OctaveList where a.Name.Trim() == octave select a).DefaultIfEmpty(null).Single(); if (o != null) { Octave = o; } return Octave; }