Ejemplo n.º 1
0
        void OnResultChanged(object sender, BaseChangedData.ChangedEventsArgs e)
        {
            // ? Возможно: если изменения извне (загрузка из файла или изменнеие контракта), закрыть (или обновить - сложнее) селектор

            this.Invalidate();
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 public void OnValueChanged(object sender, BaseChangedData.ChangedEventsArgs e)
 {
     this.Invalidate();
 }