public void OpenFile() { if (ImportSemaphore.Wait(0) == false) { return; } string filePath = Importer.OpenFileDialog(); if (filePath != null) { // TODO: // Importer.Create(filePath); } ImportSemaphore.Release(); }
private void OpenFile() { if (!ValidateToS()) { return; } if (ImportSemaphore.Wait(0) == false) { return; } string filePath = OpenFileDialog(); if (filePath != null) { ImportEpub(filePath); } ImportSemaphore.Release(); }
public async void ImportYouTubeVideo() { if (await ImportSemaphore.WaitAsync(0) == false) { return; } var res = await Application.Current.Dispatcher.Invoke(() => { return(Show.Window().For(new Prompt <string> { Message = "YouTube Id or Url:" })); }); string idOrUrl = res.Model.Value; if (!string.IsNullOrWhiteSpace(idOrUrl)) { await YouTubeMediaElement.Create(idOrUrl); } ImportSemaphore.Release(); }