private static void dict_TryRemove(object sender, CountEventArgs e) { DictionaryCount <int, string> dict = sender as DictionaryCount <int, string>; Console.WriteLine(dict.Count); Console.WriteLine("Count less than 2!"); }
/// <summary> /// Updates scroll bar and status box when the webdata controller is processing requests /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Webdata_RequestsRemaining(object sender, CountEventArgs e) { if (InvokeRequired) { Webdata_RequestsRemainingThreadsafe del = new Webdata_RequestsRemainingThreadsafe(Webdata_RequestsRemaining); Invoke(del, new object[] { sender, e }); return; } if (e.Count == 0) { progressbarWebData.Style = ProgressBarStyle.Blocks; progressbarWebData.MarqueeAnimationSpeed = 0; Webdata_Ready(null, new FlagEventArgs { Flag = true }); } else { if (progressbarWebData.Style != ProgressBarStyle.Marquee) { progressbarWebData.Style = ProgressBarStyle.Marquee; progressbarWebData.MarqueeAnimationSpeed = 50; textBoxWebDataStatus.BackColor = Color.Orange; } textBoxWebDataStatus.Text = string.Format("WORKING: {0}", e.Count); } }
private void OnCountValueChanged(CountEventArgs e) { EventHandler <CountEventArgs> temp = CountValueChanged; if (temp != null) { temp(this, e); } }
public new bool TryRemove(TKey key, out TValue value) { bool retVal = base.TryRemove(key, out value); if (this.Count <= CountToFireOn) { CountEventArgs args = new CountEventArgs(this.Count); CountLessThan(this, args); } return(retVal); }
private void Documents_CountChanged(object sender, CountEventArgs e) { if (e.Count != 0) { Content = _mainContent; } else { Content = _welcomeContent; } }
private void OnPushReceiveCount(object obj, CountEventArgs e) { if (this.InvokeRequired) { this.Invoke(new MethodInvoker(delegate { string totalCountStr = e.CountDisplayRecord.TotalCount; int totalCount = Convert.ToInt32(totalCountStr); if (totalCount >= 0) { this.notifyIcon.Icon = CountIcon.CreateTaskTrayIcon(totalCount, Properties.GlobalResources.vmoso_tasktray_icon); } })); return; } }