private async void buttonPlayMovie_Click(object sender, RoutedEventArgs e) { loadRemote(); if (_remote != null && _movie.File != null) { var response = await ConnectionHelper.ExecuteRequest(_remote.Host, _remote.Port, _remote.User, _remote.Pass, JsonHelper.JsonCommandFilesDownload(_movie.File)); if (response != "statusError" && response != "connectionError") { var file = new FileVideo(); var filePos = GetInformationHelper.getVideoFile(response); if (string.IsNullOrWhiteSpace(filePos) != true) { file.File = filePos; file.Host = _remote.Host; file.Port = _remote.Port; file.User = _remote.User; file.Pass = _remote.Pass; WindowWrapper.Current().NavigationServices.FirstOrDefault().Navigate(typeof(PlayerPage), file); } } } }
private async void listViewEpisode_ItemClick(object sender, ItemClickEventArgs e) { var clickedEpisode = (Episode)e.ClickedItem; var requestDialog = new ContentDialog() { Title = "Where do you want to play this episode?", Content = Environment.NewLine + clickedEpisode.Label, PrimaryButtonText = "Kodi", SecondaryButtonText = "mrRemote for Kodi" }; var result = await requestDialog.ShowAsync(); if (result == ContentDialogResult.Primary) { loadRemote(); if (_remote != null) { var response = await ConnectionHelper.ExecuteRequest(_remote.Host, _remote.Port, _remote.User, _remote.Pass, JsonHelper.JsonCommandPlayerOpen("episodeid", Convert.ToInt32(clickedEpisode.EpisodeId))); if (response != "statusError" && response != "connectionError") { WindowWrapper.Current().NavigationServices.FirstOrDefault().Navigate(typeof(MainPage)); } } } else if (result == ContentDialogResult.Secondary) { loadRemote(); if (_remote != null && clickedEpisode.File != null) { var response = await ConnectionHelper.ExecuteRequest(_remote.Host, _remote.Port, _remote.User, _remote.Pass, JsonHelper.JsonCommandFilesDownload(clickedEpisode.File)); if (response != "statusError" && response != "connectionError") { var file = new FileVideo(); var filePos = GetInformationHelper.getVideoFile(response); if (string.IsNullOrWhiteSpace(filePos) != true) { file.File = filePos; file.Host = _remote.Host; file.Port = _remote.Port; file.User = _remote.User; file.Pass = _remote.Pass; WindowWrapper.Current().NavigationServices.FirstOrDefault().Navigate(typeof(PlayerPage), file); } } } } }
private void BrowBtn_Click(object sender, EventArgs e) { try { if (FileVideo.ShowDialog() == DialogResult.OK) { filepath = FileVideo.FileName; filepathTxt.Text = FileVideo.FileName; int count = 0; foreach (string temp in LastList.Items) { if (temp == filepath) { count++; } } if (count == 0) { LastList.Items.Add(filepath); List <string> temp1 = new List <string>(); foreach (string temp in LastList.Items) { temp1.Add(temp); } File.WriteAllLines(FolderPath + @"\config\lastvideo.lst", temp1); } type = 1; } } catch (Exception ex) { Error error = new Error(); error.ShowError(ex); error.ShowDialog(); error.Dispose(); } }
private void SetTitle(FileVideo fv) { // Clicked on the Name property, update the title this.Text = fv.Name; this.Icon = fv.Icon; }