public Form2(Video.MovieSection initialSection, string shortName) { InitializeComponent(); int numberOfItemsInEnum = Video.MovieSection.GetNames(typeof(Video.MovieSection)).Length; // Update the radio buttons for (int i = 0; i < kNumberOfRadios; i++) { if (i < numberOfItemsInEnum) { groupBox1.Controls[i].Text = Enum.GetNames(typeof(Video.MovieSection))[i].ToString(); } else { groupBox1.Controls[i].Text = "--------"; groupBox1.Controls[i].Enabled = false; } } (groupBox1.Controls[(int)initialSection] as RadioButton).Checked = true; if (FriendlyNames.Exists(shortName)) { textBox1.Text = FriendlyNames.Lookup(shortName); } else { textBox1.Text = String.Empty; } }
private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Node is VideoNode) { VideoNode clickedNode = e.Node as VideoNode; Video video = clickedNode.Video; System.Diagnostics.Process.Start(video.FullPath); if (_setupMode) { Form2 newSectionDlg = new Form2(video.VideoSection, video.ShortName); newSectionDlg.ShowDialog(); Video.MovieSection newSection = newSectionDlg.Section; if (video.VideoSection != newSection) { video.VideoSection = newSection; } if (!String.IsNullOrWhiteSpace(newSectionDlg.NewName)) { FriendlyNames.Update(video.ShortName, newSectionDlg.NewName); clickedNode.Text = newSectionDlg.NewName; } } if (chkMarkAsViewed.Checked) { bool videoWasWatched = video.Watched; video.Watched = true; if (!videoWasWatched) { TreeNode unviewed = _sections[(int)video.VideoSection].unviewed; TreeNode viewed = _sections[(int)video.VideoSection].viewed; unviewed.Nodes.Remove(clickedNode); viewed.Nodes.Add(clickedNode); treeView1.Refresh(); } } } }
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right && e.Node is VideoNode) { VideoNode clickedNode = e.Node as VideoNode; Video video = clickedNode.Video; //_context.Show(treeView1, e.Location); Rename rename = new Rename(video.VideoSection, video.ShortName, FriendlyNames.Lookup(video.ShortName)); rename.ShowDialog(); if (rename.DialogResult == DialogResult.OK) { FriendlyNames.Update(video.ShortName, rename.NewName); clickedNode.Text = rename.NewName; } } }
public VideoNode(Video video) { _video = video; Text = FriendlyNames.Lookup(video.ShortName);; Name = video.FullPath; }
private void btnGo_Click(object sender, EventArgs e) { string logFilename = txtFilename.Text; if (!File.Exists(logFilename)) { ShowErrorMessage(@"Logfile does not exist This app is not smart enough to scan for your SteamApp folder, so you'll have to manually find it. It will be something like /Program Files/Steam Apps/Common/Late Shift/LateShift_Data/output_log.txt"); return; } List <string> watchedVideos = CalculateListOfWatchedMovies(logFilename); List <string> jobList = new List <string>(); if (watchedVideos.Count == 0) { DialogResult dr = MessageBox.Show("Did not find any watched movies. Proceed anyway?", "No watched movies", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr != DialogResult.Yes) { return; } } string videosPath = Path.GetDirectoryName(watchedVideos[0]); List <Video> videos = new List <Video>(); foreach (string f in Directory.GetFiles(videosPath)) { if (f.IndexOf("mp4", StringComparison.OrdinalIgnoreCase) != -1) { Video video = new Video(f); videos.Add(video); } } foreach (Video vid in videos) { foreach (string watchedVideo in watchedVideos) { if (string.Equals(vid.FullPath, watchedVideo, StringComparison.OrdinalIgnoreCase)) { vid.Watched = true; break; } } } _videoManager.Videos = videos; _videoManager.LoadOverVideoData(); FriendlyNames.Load(); Results results = new Results(_videoManager); results.ShowDialog(); FriendlyNames.Save(); _videoManager.SaveVideoData(); Close(); }