Exemplo n.º 1
0
        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);
        }