public void Append(DoubleLinkedListEntry <T> next)
        {
            if (Forward != null)
            {
                throw new Exception("Already Forward Linked");
            }

            if (next.Backward != null)
            {
                throw new Exception("Argument is Already Backward Linked");
            }

            Forward       = next;
            next.Backward = this;
        }
Exemplo n.º 2
0
        private static Dictionary <NoteName, DoubleLinkedListEntry <Note> > CreateNameIndex(
            DoubleLinkedListEntry <Note> chromatic)
        {
            var res  = new Dictionary <NoteName, DoubleLinkedListEntry <Note> >();
            var root = chromatic;
            var el   = chromatic;

            do
            {
                res.Add(el.Item.Name, el);
                el = el.Forward;
            } while (!ReferenceEquals(root, el));

            return(res);
        }
Exemplo n.º 3
0
 internal ScaleEnumerator(DoubleLinkedListEntry <Note> root, Pattern pattern)
 {
     _root    = root;
     _pattern = pattern;
 }
Exemplo n.º 4
0
 private IEnumerable <Note> EnumerateNotes(DoubleLinkedListEntry <Note> root, Pattern pattern)
 {
     return(new ScaleEnumerator(root, pattern));
 }