public SeasonalItemView(SeasonalCollection seasonalCollection) { InitializeComponent(); Model = seasonalCollection; collectionNameLabel.Text = Model.Name; var baseTabPage = collectionTabControl.TabPages[0]; collectionTabControl.TabPages.Remove(baseTabPage); foreach (var season in Model.Seasons) { var tabPage = new TabPage(); tabPage.Text = season.Name; tabPage.Name = season.Name; var flowLayout = new FlowLayoutPanel(); flowLayout.FlowDirection = FlowDirection.LeftToRight; flowLayout.AutoScroll = true; flowLayout.AutoSize = true; flowLayout.WrapContents = true; flowLayout.Controls.AddRange(GetVideos(season)); flowLayout.Dock = DockStyle.Fill; tabPage.Controls.Add(flowLayout); collectionTabControl.TabPages.Add(tabPage); } }
public HeadlinerController(SeasonalCollection collection) { InitializeComponent(); Model = collection; videoNameLabel.Text = collection.Name; if (collection.Seasons.Count == 0) { Context.Collections.Remove(collection); } else { this.Video = collection.Seasons[0].Videos[0]; } }
public string AddItems() { LogMessage = new StringBuilder(); var folderPath = GetFolder(); LogMessage.AppendLine($"Folder: {folderPath}"); if (string.IsNullOrEmpty(folderPath)) { return(string.Empty); } var parent = new Parent(); var collection = new SeasonalCollection() { Id = Guid.NewGuid(), IsHeadliner = true, Name = folderPath.Split('\\').Last(), Seasons = new System.ComponentModel.BindingList <Collection>() }; parent.SeasonalCollectionId = collection.Id; var directories = Directory.GetDirectories(folderPath); if (directories.Count() > 0) { foreach (var directory in directories) { Collection season = GetSeason(directory, parent); if (season.Videos.Any()) { collection.Seasons.Add(season); } } } else { Collection season = GetSeason(folderPath, parent); if (season.Videos.Any()) { collection.Seasons.Add(season); } } Context.Collections.Add(collection); Context.Save(); return(LogMessage.ToString()); }
internal void SwitchToSeasonalItemScreen(SeasonalCollection collection) { var userControl = new SeasonalItemView(collection); SwitchView(userControl); }