예제 #1
0
        /// <summary>
        /// Remplit les différents champs d'édition de l'épisode.
        /// </summary>
        /// <param name="ep"></param>
        private void FillEpisodeData(TvShowEpisode ep)
        {
            try
            {
                if (ep != null)
                {
                    TboxTitle.Text = ep.Title;
                    TboxName.Text = ep.Name;
                    TboxSerie.Text = ep.TvShow;
                    TboxSerieMatch.Text = ep.TvShowMatch;
                    TboxSaison.Text = ep.Season;
                    ClistAvailableFiles.Items.Clear();
                    if (ep.PossibleFiles == null)
                        FillEpisodePossible(ep, false);

                    foreach (PossibleFile file in ep.PossibleFiles)
                        ClistAvailableFiles.Items.Add(file, file.ToCopy);
                    TboxNumbers.Text = string.Join("-", ep.Numbers.ToArray<string>());
                    SetEditableFields(true);
                    lancerToolStripMenuItem.Enabled = ButGo.Enabled = ClistToCopy.CheckedItems.Count > 0;
                    if (ep.GetType() == typeof(AnimeEpisode))
                    {
                        AnimeEpisode an = (AnimeEpisode)ep;
                        TboxID.Text = string.Join("-", an.ID.ToArray<string>());
                        TboxApercuCopy.Text = ep.ApplyFilter();
                        ButSearchAnime.Enabled = CboxFoldersAnime.Enabled = TboxID.Enabled = true;
                    }
                    else
                    {
                        TboxID.Text = string.Empty;
                        TboxApercuCopy.Text = ep.ApplyFilter();
                        ButSearchAnime.Enabled = CboxFoldersAnime.Enabled = TboxID.Enabled = false;
                    }
                }
            }
            catch (Exception ex)
            {
                WriteLog(ex);
            }
        }
예제 #2
0
 /// <summary>
 /// Génère l'aperçu de la série
 /// </summary>
 private void GenerateApercuSerie()
 {
     try
     {
         TvShowEpisode ep = new TvShowEpisode(_serie_exemple, TboxSeriesFilter.Text);
         TBoxSeriesApercu.Text = ep.ApplyFilter();
     }
     catch { }
 }
예제 #3
0
 private void bgWorkerRenameLoad_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
 {
     TboxOldFilter.Enabled = CboxRenameSource.Enabled = false;
     string[] files = new string[0];
     foreach (string ext in TvShowEpisode.AvailableExtensions)
         files = files.Concat(Directory.GetFiles(((SourceFolder)CboxRenameSource.SelectedItem).FolderPath, "*." + ext, SearchOption.AllDirectories)).ToArray();
     if (files.Length > 0)
     {
         TvShowEpisode ep = new TvShowEpisode(files[0]);
         DestinationFolder dest = new DestinationFolder(((SourceFolder)CboxRenameSource.SelectedItem).FolderPath);
         List<DestinationFolder> folder = new List<DestinationFolder>();
         folder.Add(dest);
         //ep.FillTitle(0, folder);
         try
         {
             ep.FillFromFilter(TboxOldFilter.Text);
             ep.Filter = TboxSeriesFilter.Text;
             TboxApercuRename.Text = ep.ApplyFilter();
         }
         catch
         {
             TboxApercuRename.Text = ep.FileName;
         }
     }
 }