internal static void AddVirtualGenre(IVirtualGenre vgenre) { Program.mainForm.AddVirtualGenre(vgenre); Program.mainForm.Focus(); }
private bool AddTabIfNotExists(IVirtualGenre vgenre) { foreach (GenreTabPage gtp in this.tabcGsc.TabPages) { VGenreTabPage vgtp = gtp as VGenreTabPage; if (null != vgtp) { if (vgtp.VirtualGenre.ShortName == vgenre.ShortName && vgtp.VirtualGenre.LongName == vgenre.LongName) return false; } } this.AddGenreTabInternal(new VGenreTabPage(vgenre)); return true; }
public VGenreTabPage(IVirtualGenre vgenre) : base(vgenre.ShortName, vgenre.LongName) { this.vgenre = vgenre; }
public void AddAndSelectVirtualGenre(IVirtualGenre vgenre) { if (this.AddTabIfNotExists(vgenre)) { this.tabcGsc.SelectedIndex = this.tabcGsc.TabCount - 1; this.HandleTabChangeInternal(); } else { foreach (GenreTabPage gtp in this.tabcGsc.TabPages) { VGenreTabPage vgtp = gtp as VGenreTabPage; if (null != vgtp) { if (vgtp.VirtualGenre.ShortName == vgenre.ShortName && vgtp.VirtualGenre.LongName == vgenre.LongName) { this.tabcGsc.SelectedTab = vgtp; break; } } } } }
public void AddVirtualGenre(IVirtualGenre vgenre) { this.genreSelctControl1.AddAndSelectVirtualGenre(vgenre); }