コード例 #1
0
ファイル: Form1.cs プロジェクト: thetornadotitan/MediaTracker
        private void UpdateFlowControl(string path)
        {
            EpisodeFlow.Controls.Clear();
            CreateRegressControls(path);

            string[] directories;

            try
            {
                directories = Directory.GetDirectories(path);
            }
            catch
            {
                DisplayRootDirectory(null, null);
                return;
            }

            foreach (string d in directories)
            {
                if (Directory.Exists(d))
                {
                    EpisodeFlow.Controls.Add(new DirectoryControl(d, this));
                }
            }

            string[] files = Directory.GetFiles(path);

            foreach (string f in files)
            {
                if (ShowHelper.IsShow(f) && File.Exists(f))
                {
                    EpisodeFlow.Controls.Add(new EpisodeControl(f));
                }
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: thetornadotitan/MediaTracker
        private void button2_Click(object sender, EventArgs e)
        {
            string[] files = Directory.GetFiles(workingDirectory);

            foreach (string f in files)
            {
                if (ShowHelper.IsShow(f) && File.Exists(f))
                {
                    string filePathName = f.Replace('\\', '_');
                    filePathName = filePathName.Replace(':', '_');
                    filePathName = filePathName.Remove(0, 3);
                    XMLHelper.SetWatched(filePathName, false);
                    foreach (Panel ep in EpisodeFlow.Controls)
                    {
                        try
                        {
                            EpisodeControl epc = ep as EpisodeControl;
                            epc.RefreshEpisodeStatus(filePathName, false);
                        }
                        catch
                        {
                            continue;
                        }
                    }
                }
            }
            EpisodeFlow.Refresh();
        }