private void addToItem_Click(object sender, EventArgs e) { var toolStripItem = sender as ToolStripItem; if (toolStripItem == null) { return; } if (repository == null) { return; } foreach (RepositoryCategory newRepositoryCategory in Repositories.RepositoryCategories) { if (newRepositoryCategory.Description.Equals(toolStripItem.Text)) { RepositoryCategory.RemoveRepository(repository); repository.RepositoryType = RepositoryType.Repository; newRepositoryCategory.AddRepository(repository); } } dashboardCategoryChanged(this, null); }
private void newCategoryMenuItem_Click(object sender, EventArgs e) { if (repository == null) { return; } RepositoryCategory newRepositoryCategory; using (var formDashboardCategoryTitle = new FormDashboardCategoryTitle()) { formDashboardCategoryTitle.ShowDialog(this); if (string.IsNullOrEmpty(formDashboardCategoryTitle.GetTitle())) { return; } newRepositoryCategory = new RepositoryCategory(formDashboardCategoryTitle.GetTitle()); } RepositoryCategory.RemoveRepository(repository); repository.RepositoryType = RepositoryType.Repository; newRepositoryCategory.AddRepository(repository); Repositories.RepositoryCategories.Add(newRepositoryCategory); dashboardCategoryChanged(this, null); }
private void newCategoryMenuItem_Click(object sender, EventArgs e) { var toolStripItem = sender as ToolStripItem; if (toolStripItem == null) { return; } var repository = toolStripItem.Tag as Repository; if (repository == null) { return; } var formDashboardCategoryTitle = new FormDashboardCategoryTitle(); formDashboardCategoryTitle.ShowDialog(this); if (string.IsNullOrEmpty(formDashboardCategoryTitle.GetTitle())) { return; } var newRepositoryCategory = new RepositoryCategory(formDashboardCategoryTitle.GetTitle()); RepositoryCategory.RemoveRepository(repository); repository.RepositoryType = RepositoryType.Repository; newRepositoryCategory.AddRepository(repository); Repositories.RepositoryCategories.Add(newRepositoryCategory); dashboardCategoryChanged(this, null); }
private void removeMenuItem_Click(object sender, EventArgs e) { if (repository == null) { return; } RepositoryCategory.RemoveRepository(repository); repositoryRemoved(repository); dashboardCategoryChanged(this, null); }
private void removeMenuItem_Click(object sender, EventArgs e) { var toolStripItem = sender as ToolStripItem; if (toolStripItem == null) { return; } var repository = toolStripItem.Tag as Repository; if (repository == null) { return; } RepositoryCategory.RemoveRepository(repository); repositoryRemoved(repository); dashboardCategoryChanged(this, null); }