/// <summary> /// Opens a file. /// TODO: Remove the calling of the outer viewmodel layer. We want to be able reuse this in an ASP.NET Core application for example. /// </summary> /// <param name="fileName"></param> public void OpenFile(string fileName) { IFileReader fileReader = new FileReaderFactory().GetFactory(fileName); this.LilypondText = fileReader.Load(fileName); this.LilypondViewModel.LilypondTextLoaded(this.LilypondText); LoadLilypondIntoWpfStaffsAndMidi(LilypondText); }
public void OpenFile(string path) { WPFStaffs.Clear(); FilePath = path; String extension = Path.GetExtension(path); IFileReader reader = new FileReaderFactory().Get(extension); var musicSheet = reader.ReadFile(path); var symbolString = musicSheet.SymbolsContent.ToString(); LoadLilypond(symbolString); this.State = new MusicEditingState(this); }