示例#1
0
        public void OpenFile()
        {
            if (ImportSemaphore.Wait(0) == false)
            {
                return;
            }

            string filePath = Importer.OpenFileDialog();

            if (filePath != null)
            {
                // TODO:
                // Importer.Create(filePath);
            }

            ImportSemaphore.Release();
        }
示例#2
0
        private void OpenFile()
        {
            if (!ValidateToS())
            {
                return;
            }

            if (ImportSemaphore.Wait(0) == false)
            {
                return;
            }

            string filePath = OpenFileDialog();

            if (filePath != null)
            {
                ImportEpub(filePath);
            }

            ImportSemaphore.Release();
        }
示例#3
0
        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();
        }