private void LabelOnClick(object sender, EventArgs eventArgs) { XPLinkLabel label = sender as XPLinkLabel; TeamProjectEntry entry = label.Tag as TeamProjectEntry; InternalCheckItem(label, !entry.Checked); if (this.chAutoApply.Checked && allowedAutoApply) { ApplyFilter(); } }
private void InternalCheckItem(XPLinkLabel label, bool @checked) { TeamProjectEntry entry = label.Tag as TeamProjectEntry; entry.Checked = @checked; this.linkToolTip.SetToolTip(label, string.Format("Click to {0} team project '{1}' {2} filter", entry.Checked ? "exclude" : "include", label.Text, entry.Checked ? "from" : "into")); label.BackColor = entry.Checked ? SystemColors.ControlLight : SystemColors.Control; label.ColorNormal = entry.Checked ? SystemColors.Highlight : SystemColors.ControlDark; }
public bool IsCheckedProject(string teamProject) { bool result = false; foreach (var item in items) { TeamProjectEntry entry = item.Value.Tag as TeamProjectEntry; if (item.Key == teamProject) { result = entry.Checked; } } return(result); }