GitUI.DashboardCategory.newCategoryMenuItem_Click C# (CSharp) Метод

newCategoryMenuItem_Click() приватный Метод

private newCategoryMenuItem_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
Результат void
        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);
        }