コード例 #1
0
    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!");
    }
コード例 #2
0
        /// <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);
            }
        }
コード例 #3
0
    private void OnCountValueChanged(CountEventArgs e)
    {
        EventHandler <CountEventArgs> temp = CountValueChanged;

        if (temp != null)
        {
            temp(this, e);
        }
    }
コード例 #4
0
        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);
        }
コード例 #5
0
 private void Documents_CountChanged(object sender, CountEventArgs e)
 {
     if (e.Count != 0)
     {
         Content = _mainContent;
     }
     else
     {
         Content = _welcomeContent;
     }
 }
コード例 #6
0
ファイル: MainForm.cs プロジェクト: xxyying/vmClone
        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;
            }
        }