public void Invoke <T>(CareTaker <T> careTaker) { var fact = new SheetReaderFactory(); var extensions = fact.GetAllSupportedExtension().Select(x => { var e = $"*{x.ext}"; if (x.ext.StartsWith("(", StringComparison.InvariantCultureIgnoreCase)) { e = x.ext.Replace("(", "").Replace(")", "").Replace("|", ";").Replace(".", "*."); } return($"{x.name}|{e}"); }); var fileService = ServiceLocator.Current.GetInstance <IFileService>(); var path = fileService.RequestReadPath(string.Join("|", extensions.ToArray())); if (!string.IsNullOrWhiteSpace(path)) { Messenger.Default.Send(new CurrentPathMessage() { FilePath = path }); } }
public async Task TestLy() { var writerFactory = new SheetWriterFactory(); var writerExt = writerFactory.GetAllSupportedExtension(); var readerFactory = new SheetReaderFactory(); var readerExt = readerFactory.GetAllSupportedExtension(); var reader = readerFactory.GetReader("../../../DPA_Musicsheets/Files/Twee-emmertjes-water-halen.ly"); //reader.SetFilePath("../../../DPA_Musicsheets/Files/Alle-eendjes-zwemmen-in-het-water.ly"); reader.SetFilePath("../../../DPA_Musicsheets/Files/Twee-emmertjes-water-halen.ly"); var resultA = await reader.ReadFromFileAsync(); var resultB = await reader.ReadFromFileAsync(); var writerA = writerFactory.GetWriter("hallo.ly"); var strResultA = await writerA.WriteToString(resultA); var strResultB = await writerA.WriteToString(resultB); var nothing = string.Empty; }