예제 #1
0
 private void EditAnnounceWithID(string _id)
 {
     try
     {
         int id = Convert.ToInt32(_id);
         // find current announcement in memory
         MovieFile existAnn = Program.currentProject.FindAnnouncWithID(id);
         // find all additional data for the given announcement id
         Dictionary <string, MovieFile> nonEngData = Program.currentProject.ReadAnnouncNonEnglishData(id);
         frmAddMovie existAnnDlg = new frmAddMovie(existAnn, false, nonEngData);
         existAnnDlg.Text = "Edit Announcement";
         if (existAnnDlg.ShowDialog(this) == DialogResult.OK)
         {
             if (existAnnDlg.nonEngAdditionalData.Count > 0)
             {
                 Program.currentProject.SaveAnnouncesNonEnglishData(existAnnDlg.nonEngAdditionalData);
             }
             this.ApplyChangesOnHardDrive();;
         }
         this.UpdateTreesPresentation();
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }
예제 #2
0
 private void textBox3_TextChanged(object sender, EventArgs e)
 {
     try
     {
         if (textBox3.Text != "")
         {
             foreach (TreeNode node in treeAnnounc.Nodes[0].Nodes)
             {
                 MovieFile toSearch = Program.currentProject.FindAnnouncWithID(Convert.ToInt32(ExtractIDFromNodeLabel(node.Text)));
                 if (toSearch.description.ToLower().Contains(textBox1.Text.ToLower()) ||
                     toSearch.id.ToString().ToLower().Contains(textBox1.Text.ToLower()) ||
                     toSearch.title.ToLower().Contains(textBox1.Text.ToLower()))
                 {
                     treeAnnounc.Nodes[0].Nodes.Clear();
                     treeAnnounc.Nodes[0].Nodes.Add(node);
                     return;
                 }
             }
         }
         UpdateTreesPresentation();
         return;
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }
예제 #3
0
 public frmAddMovie(MovieFile _movToComplete, bool _isNew, Dictionary <string, MovieFile> _nonEngData)
 {
     InitializeComponent();
     movieToComplete = _movToComplete;
     if (_nonEngData == null)
     {
         nonEngAdditionalData = new Dictionary <string, MovieFile>();
     }
     else
     {
         nonEngAdditionalData = _nonEngData;
     }
     isNewMovie = _isNew;
 }
예제 #4
0
        private MovieFile FindMovieWithID(int _id)
        {
            MovieFile retval = null;

            foreach (MovieFile x in this.library)
            {
                if (x.id == _id)
                {
                    retval = x;
                    break;
                }
            }
            return(retval);
        }
예제 #5
0
        internal MovieFile FindAnnouncWithID(int _id)
        {
            MovieFile retval = null;

            foreach (MovieFile x in this.announces.library)
            {
                if (x.id == _id)
                {
                    retval = x;
                    break;
                }
            }
            return(retval);
        }
예제 #6
0
 internal void CopyTo(MovieFile _m)
 {
     _m.id              = this.id;
     _m.language.audio  = this.language.audio;
     _m.video.path      = this.video.path;
     _m.video.quality   = this.video.quality;
     _m.trailer.path    = this.trailer.path;
     _m.trailer.quality = this.trailer.quality;
     _m.cover           = this.cover;
     _m.director        = this.director;
     _m.ageCategory     = this.ageCategory;
     _m.genre           = this.genre;
     _m.title           = this.title;
     _m.artist          = this.artist;
     _m.description     = this.description;
     return;
 }
예제 #7
0
 private void additionalLangRecord_EditButton_Click(object sender, LabelEditEventArgs e)
 {
     try
     {
         MovieFile         temp      = nonEngAdditionalData[e.Label];
         frmAddNewLanguage frmNewDlg = new frmAddNewLanguage(e.Label, temp.title, temp.artist, temp.description);
         if (frmNewDlg.ShowDialog(this) == DialogResult.OK)
         {
             temp.title       = frmNewDlg.InsertedTitle;
             temp.artist      = frmNewDlg.InsertedArtists;
             temp.description = frmNewDlg.InsertedDescription;
         }
         UpdateLangsPanel();
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }
예제 #8
0
 private void btnAddMovie_Click(object sender, EventArgs e)
 {
     try
     {
         int         id        = Program.currentProject.FindLastMovieID();
         MovieFile   newMovie  = new MovieFile(id);
         frmAddMovie newMovDlg = new frmAddMovie(newMovie, true, null);
         if (newMovDlg.ShowDialog(this) == DialogResult.OK)
         {
             Program.currentProject.AddMovie(newMovie);
             if (newMovDlg.nonEngAdditionalData.Count > 0)
             {
                 Program.currentProject.SaveMoviesNonEnglishData(newMovDlg.nonEngAdditionalData);
             }
             this.ApplyChangesOnHardDrive();
         }
         this.UpdateTreesPresentation();
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }
예제 #9
0
 private void btnNewLang_Click(object sender, EventArgs e)
 {
     try
     {
         // fetch which additional langs already filled for current playlist
         string[] existlangs = new string[nonEngAdditionalData.Count];
         int      i          = 0;
         foreach (var item in nonEngAdditionalData)
         {
             existlangs[i++] = item.Key;
         }
         // if all additional langs already filled, no action occurred
         if (existlangs.Length == Enum.GetValues(typeof(Languages)).Length)
         {
             return;
         }
         frmAddNewLanguage newDlg = new frmAddNewLanguage(!EnglishMoreDataExist(), existlangs);
         if (newDlg.ShowDialog(this) == DialogResult.OK)
         {
             MovieFile p = new MovieFile(movieToComplete.id);
             p.title       = newDlg.InsertedTitle;
             p.artist      = newDlg.InsertedArtists;
             p.description = newDlg.InsertedDescription;
             if (nonEngAdditionalData.ContainsKey(newDlg.SelectedLanguage))
             {
                 nonEngAdditionalData.Remove(newDlg.SelectedLanguage);
             }
             nonEngAdditionalData.Add(newDlg.SelectedLanguage, p);
         }
         UpdateLangsPanel();
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }
예제 #10
0
 internal MovieFile[] GetAnnouncesCollection()
 {
     MovieFile[] retVal = new MovieFile[this.announces.library.Count];
     this.announces.library.CopyTo(retVal);
     return(retVal);
 }
예제 #11
0
 internal void AddAnnouncement(MovieFile _newMovie)
 {
     this.announces.library.Add(_newMovie);
 }
예제 #12
0
 internal void AddMovie(MovieFile _newMovie)
 {
     this.movies.library.Add(_newMovie);
 }