Exemplo n.º 1
0
 public void StoreOpenTabs(GenreSelectControlOptions options)
 {
     List<int> openTabs = new List<int>();
     foreach (GenreTabPage gtp in this.tabcGsc.TabPages) {
         GGenreTabPage ggtp = gtp as GGenreTabPage;
         if (null != ggtp) {
             openTabs.Add(ggtp.Genre.GenreKey);
         }
     }
     options.OpenTabs = openTabs;
 }
Exemplo n.º 2
0
 public void LoadOpenTabs(GenreSelectControlOptions options)
 {
     if (null == options.OpenTabs) {
         this.tsmiAddAllGenres.PerformClick();
         options.OpenTabs = new List<int>();
     } else {
         if (options.RestoreOpenTabs) {
             Dictionary<int, GGenreClass> genres = new Dictionary<int, GGenreClass>();
             foreach (GGenreClass genre in Program.CacheController.GetEnumerableOfVisibleGenres()) {
                 genres.Add(genre.GenreKey, genre);
             }
             this.BeginUpdateGenreTabs();
             foreach (int gKey in options.OpenTabs) {
                 GGenreClass genre;
                 if (genres.TryGetValue(gKey, out genre)) {
                     this.AddTabIfNotExists(genre);
                 }
             }
             this.tabcGsc.SelectedIndex = -1;
             this.EndUpdateGenreTabs();
         }
     }
 }