/// <summary> /// Updates fret note's from the NoteList. /// Updates their state property. /// </summary> /// <param name="newScale">Passes its values to Scale property</param> public void UpdateScale(string newScale) { Scale = newScale; string[] scale = (from node in Doc.Descendants("Scales").Elements("Scale") where node.Element("Name").Value == Scale select node.Element("Interval").Value).Single().Split(' '); // Shifting scale to new root note foreach (List <FretNote> String in NoteList) { foreach (FretNote Note in String) { IntLimited a = new IntLimited(Note.Index - Root, 0, 12); Note.ChangeState(scale.Contains((a.Value).ToString()) ? true : false); } } }