public void HandleTreeCountChanged(TallyCountChangedEventArgs ea)
 {
     foreach (Control c in _tallyContainer_PNL.Controls)
     {
         var tallyButton = c as FixCNTTallyButton;
         if (tallyButton != null)
         {
             tallyButton.HandleTreeCountChanged(ea);
         }
     }
 }
        void UpdateTallyCount(TallyCountChangedEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            foreach (var c in Controls)
            {
                var tallyRow = c as FixCntTallyRow;
                if (tallyRow != null)
                {
                    tallyRow.HandleTreeCountChanged(e);
                }
            }
        }
        void WireTallyCountProvider()
        {
            var tallyCountProvider = TallyCountProvider;

            if (tallyCountProvider != null)
            {
                tallyCountProvider.TallyCountChanged += new EventHandler <TallyCountChangedEventArgs>(tallyCountProvider_TallyCountChanged);

                var updateEventArgs =
                    new TallyCountChangedEventArgs()
                {
                    CountProvider = tallyCountProvider
                };

                UpdateTallyCount(updateEventArgs);
            }
        }
        public void HandleTreeCountChanged(TallyCountChangedEventArgs ea)
        {
            if (ea.TallyBucket != null &&
                object.ReferenceEquals(ea.TallyBucket, this))
            {
                return;
            }

            var tallyCountProvider = ea.CountProvider;

            if (tallyCountProvider != null)
            {
                var tallyCount = tallyCountProvider.GetTallyCount(this.Bucket);
                _tallyCount_LBL.Text = tallyCount.ToString();
            }
            else
            {
                _tallyCount_LBL.Text = "-";
            }
        }
 void tallyCountProvider_TallyCountChanged(object sender, TallyCountChangedEventArgs e)
 {
     UpdateTallyCount(e);
 }