private void tsSetDeny_Click(object sender, EventArgs e) { SelectionBase selection = (SelectionBase)grid1.Selection; var region = selection.GetSelectionRegion(); foreach (var range in region) { for (int i = range.Start.Row; i <= range.End.Row; i++) { string channel = grid1[i, 2].Value.ToString(); string item = grid1[i, 3].Value.ToString(); if (!Deny.ContainsKey(channel)) { Deny.Add(channel, new List <string>()); } Deny[channel].Add(item); } } _Save(); _ApplyAllowDeny(); c_Summary.SetValue(m_Channels.Count); m_DenyForm.ResetItem(); var sum = Deny.Sum(entry => entry.Value.Count); tsDeny.Text = sum == 0 ? string.Empty : $"[{sum}]"; }
private void tsDeny_Click(object sender, EventArgs e) { m_DenyForm.ShowDialog(this); _ApplyAllowDeny(); var sum = Deny.Sum(entry => entry.Value.Count); tsDeny.Text = sum == 0 ? string.Empty : $"[{sum}]"; }
private void _CreateDenyAllowForm() { m_DenyForm = new frmDeny(m_Identity, Deny); m_AllowForm = new frmAllow(m_Identity, Allow); var dsum = Deny.Sum(entry => entry.Value.Count); tsDeny.Text = dsum == 0 ? string.Empty : $"[{dsum}]"; var asum = Allow.Sum(entry => entry.Value.Count) + Allow.Count(entry => entry.Value == null || entry.Value.Count <= 0); tsAllow.Text = asum == 0 ? string.Empty : $"[{asum}]"; }