void OnResultChanged(object sender, BaseChangedData.ChangedEventsArgs e)
        {
            if (((ResultStruct)e._new).Born != ((ResultStruct)e._old).Born)
            {
                this.Invalidate();
            }
            else if (((ResultStruct)e._old).Quantity != ((ResultStruct)e._new).Quantity)
            {
                Graphics g = this.CreateGraphics();
                RectangleF rf, rf2;
                rf = SmallHelper.StringInMiddle(g, new Rectangle(m_rect_QuantityDecreaseBounds.Right, m_rect_QuantityDecreaseBounds.Top, m_rect_QuantityIncreaseBounds.Left - m_rect_QuantityDecreaseBounds.Right, m_rect_QuantityDecreaseBounds.Height), ((ResultStruct)e._old).ToString(), this.Font);
                rf2 = SmallHelper.StringInMiddle(g, new Rectangle(m_rect_QuantityDecreaseBounds.Right, m_rect_QuantityDecreaseBounds.Top, m_rect_QuantityIncreaseBounds.Left - m_rect_QuantityDecreaseBounds.Right, m_rect_QuantityDecreaseBounds.Height), ((ResultStruct)e._new).ToString(), this.Font);
                this.Invalidate(new Rectangle((int)rf.X, (int)rf.Y, (int)rf.Width, (int)rf.Height));
                this.Invalidate(new Rectangle((int)rf2.X, (int)rf2.Y, (int)rf2.Width, (int)rf2.Height));
                g.Dispose();

                if (((ResultStruct)e._new).Quantity > ((ResultStruct)e._old).Quantity && ((ResultStruct)e._old).IsMin)
                    this.Invalidate(m_rect_QuantityDecreaseBounds);

                if (((ResultStruct)e._new).Quantity < ((ResultStruct)e._old).Quantity && ((ResultStruct)e._old).IsMax)
                    this.Invalidate(m_rect_QuantityIncreaseBounds);
            }
        }
        void OnContractChanged(object sender, BaseChangedData.ChangedEventsArgs e)
        {
            if (((ContractStruct)e._old).Quantity != ((ContractStruct)e._new).Quantity && this.m_result.Born)
            {
                // обнулить и заблокировать результат
                this.m_result.EmptyAndDead();

                //или

                // сдвинуть результат
                //int diff = ((ContractStruct)e._new).Quantity - ((ContractStruct)e._old).Quantity;
                //this.m_result.Quantity -= diff;
            }
        }
        void OnDataChanged(object sender, BaseChangedData.ChangedEventsArgs e)
        {
            this.tbN.Text = this.cd.GetCount(Quarters.N).ToString();
            this.tbS.Text = this.cd.GetCount(Quarters.S).ToString();
            this.tbE.Text = this.cd.GetCount(Quarters.E).ToString();
            this.tbW.Text = this.cd.GetCount(Quarters.W).ToString();

            this.btnAUTO.Enabled = this.cd.CanMeAutocompletePlease(out q_CompleteMePlease);
        }
 void OnInputChanged_SaveToDataBase(object sender, BaseChangedData.ChangedEventsArgs e)
 {
     for (int i = 0; i < VALUES.Count; i++)
     {
         if (VALUES[i].Contains(sender))
         {
             //MessageBox.Show("before save " + sender.GetType().ToString()); //анука удолил
             DB_Save(i, VALUES[i].IndexOf(sender));
             //MessageBox.Show("after save " + sender.GetType().ToString()); //анука удолил
             return;
         }
     }
 }
 void OnInputChanged(object sender, BaseChangedData.ChangedEventsArgs e)
 {
     for (int i = 0; i < VALUES.Count; i++)
     {
         if (VALUES[i].Contains(sender))
         {
             //MessageBox.Show("before reflect " + sender.GetType().ToString()); //анука удолил
             REFLECT_DEPENDENCES(i, VALUES[i].IndexOf(sender));
             //MessageBox.Show("after reflect " + sender.GetType().ToString()); //анука удолил
             return;
         }
     }
 }
        void OnContractChanged(object sender, BaseChangedData.ChangedEventsArgs e)
        {
            if (((ContractStruct)e._old).Quantity != ((ContractStruct)e._new).Quantity)
            {
                Graphics g = this.CreateGraphics();
                RectangleF rf, rf2;
                rf = SmallHelper.StringInMiddle(g, new Rectangle(m_rect_QuantityDecreaseBounds.Right, m_rect_QuantityDecreaseBounds.Top, m_rect_QuantityIncreaseBounds.Left - m_rect_QuantityDecreaseBounds.Right, m_rect_QuantityDecreaseBounds.Height), ((ContractStruct)e._old).GetString1(), quantityNum_font);
                rf2 = SmallHelper.StringInMiddle(g, new Rectangle(m_rect_QuantityDecreaseBounds.Right, m_rect_QuantityDecreaseBounds.Top, m_rect_QuantityIncreaseBounds.Left - m_rect_QuantityDecreaseBounds.Right, m_rect_QuantityDecreaseBounds.Height), ((ContractStruct)e._new).GetString1(), quantityNum_font);
                this.Invalidate(new Rectangle((int)rf.X, (int)rf.Y, (int)rf.Width, (int)rf.Height));
                this.Invalidate(new Rectangle((int)rf2.X, (int)rf2.Y, (int)rf2.Width, (int)rf2.Height));
                g.Dispose();

                if (((ContractStruct)e._new).Quantity == 0 || ((ContractStruct)e._old).Quantity == 0)
                {
                    this.Invalidate(m_rect_QuantityDecreaseBounds);
                    this.Invalidate(m_rect_QuantityIncreaseBounds);
                }
                else
                {
                    if (((ContractStruct)e._new).Quantity > ((ContractStruct)e._old).Quantity && ((ContractStruct)e._old).Quantity == 1)
                        this.Invalidate(m_rect_QuantityDecreaseBounds);
                    if (((ContractStruct)e._new).Quantity < ((ContractStruct)e._old).Quantity && ((ContractStruct)e._old).Quantity == 7)
                        this.Invalidate(m_rect_QuantityIncreaseBounds);
                }
            }

            if (((ContractStruct)e._old).Trump != ((ContractStruct)e._new).Trump)
            {
                switch (((ContractStruct)e._old).Trump)
                {
                    case CardTrump.Clubs:
                        this.Invalidate(m_rect_ClubsBounds);
                        break;
                    case CardTrump.Diamonds:
                        this.Invalidate(m_rect_DiamondsBounds);
                        break;
                    case CardTrump.Hearts:
                        this.Invalidate(m_rect_HeartsBounds);
                        break;
                    case CardTrump.Spades:
                        this.Invalidate(m_rect_SpadesBounds);
                        break;
                    case CardTrump.NT:
                        this.Invalidate(m_rect_NTBounds);
                        break;
                }
            }

            if (((ContractStruct)e._old).Contra != ((ContractStruct)e._new).Contra)
            {
                this.Invalidate(new Rectangle(m_rect_ContraBounds.Left + check_offset_img.X, m_rect_ContraBounds.Top + check_offset_img.Y, m_bmp_Check_True.Width, m_bmp_Check_True.Height));
            }

            if (((ContractStruct)e._old).ReContra != ((ContractStruct)e._new).ReContra)
            {
                this.Invalidate(new Rectangle(m_rect_ReContraBounds.Left + check_offset_img.X, m_rect_ReContraBounds.Top + check_offset_img.Y, m_bmp_Check_True.Width, m_bmp_Check_True.Height));
            }

            if (((ContractStruct)e._old).NoContract != ((ContractStruct)e._new).NoContract)
            {
                this.Invalidate(m_rect_NOCONTRACT);
            }
        }