public DashboardCategory(string title, RepositoryCategory repositoryCategory) { InitializeComponent(); Translate(); this.Title = title; this.RepositoryCategory = repositoryCategory; this.AutoSizeMode = AutoSizeMode.GrowAndShrink; }
void newCategoryMenuItem_Click(object sender, EventArgs e) { ToolStripItem toolStripItem = sender as ToolStripItem; if (toolStripItem == null) return; Repository repository = toolStripItem.Tag as Repository; if (repository == null) return; FormDashboardCategoryTitle formDashboardCategoryTitle = new FormDashboardCategoryTitle(); formDashboardCategoryTitle.ShowDialog(); if (string.IsNullOrEmpty(formDashboardCategoryTitle.GetTitle())) return; RepositoryCategory newRepositoryCategory = new RepositoryCategory(formDashboardCategoryTitle.GetTitle()); RepositoryCategory.RemoveRepository(repository); repository.RepositoryType = RepositoryType.Repository; newRepositoryCategory.AddRepository(repository); Repositories.RepositoryCategories.Add(newRepositoryCategory); dashboardCategoryChanged(this, null); }
public static void AddCategory(string title) { RepositoryCategory repositoryCategory = new RepositoryCategory(); repositoryCategory.Description = title; RepositoryCategories.Add( repositoryCategory); }
private int AddDashboardEntry(int y, RepositoryCategory entry) { DashboardCategory dashboardCategory = new DashboardCategory(entry.Description, entry); dashboardCategory.Location = new Point(0, y); dashboardCategory.Width = splitContainer5.Panel2.Width; dashboardCategory.DashboardItemClick += new EventHandler(dashboardItem_Click); splitContainer5.Panel2.Controls.Add(dashboardCategory); dashboardCategory.BringToFront(); y += dashboardCategory.Height; //Recalculate hieght when list is changed //entry.ListChanged += entry_ListChanged; dashboardCategory.DashboardCategoryChanged += new EventHandler(dashboardCategory_DashboardCategoryChanged); return y; }