private Task <ObservableDiagram> RenderChordAsync(IChordFinderResult result)
 {
     return(Task <ObservableDiagram> .Factory.StartNew(() =>
     {
         ObservableDiagram od = null;
         AppVM.AppView.DoOnUIThread(() =>
         {
             try
             {
                 od = new ObservableDiagram(result.ToDiagram(Style), name: Strings.FinderResultDiagramName);
                 od.PostEditCallback = (changed) =>
                 {
                     if (changed)
                     {
                         od.Refresh();
                     }
                 };
             }
             catch (Exception ex)
             {
                 ExceptionUtils.HandleException(ex);
             }
         });
         return od;
     }));
 }
Example #2
0
            public int CompareTo(object obj)
            {
                if (null == obj)
                {
                    throw new ArgumentNullException(nameof(obj));
                }

                IChordFinderResult cfr = obj as IChordFinderResult;

                if (null == cfr)
                {
                    throw new ArgumentException();
                }

                return(Marks.SequenceEqual(cfr.Marks) ? 0 : -1);
            }
        public Diagram DiagramAt(int index, ChordFinderStyle chordFinderStyle)
        {
            IChordFinderResult result = ResultAt(index);

            return(result.ToDiagram(chordFinderStyle));
        }