Ejemplo n.º 1
0
        private void InitializeButtons(bool update = false)
        {
            if (SManager.AssetPrimary.Buy)
            {
                URbtnAssetPrimaryBuy.Class    = button_success;
                URbtnAssetPrimarySell.Class   = button_null;
                URbtnAssetSecondaryBuy.Class  = button_null;
                URbtnAssetSecondarySell.Class = button_danger;

                UTbxAmountPrimary.CssClass   = textbox_success;
                UTbxAmountSecondary.CssClass = textbox_danger;
            }

            if (SManager.AssetSecondary.Buy)
            {
                URbtnAssetPrimaryBuy.Class    = button_null;
                URbtnAssetPrimarySell.Class   = button_danger;
                URbtnAssetSecondaryBuy.Class  = button_success;
                URbtnAssetSecondarySell.Class = button_null;

                UTbxAmountPrimary.CssClass   = textbox_danger;
                UTbxAmountSecondary.CssClass = textbox_success;
            }

            if (SManager.AssetPrimary.IsFixed)
            {
                UTbxAmountPrimary.ForeColor         = System.Drawing.Color.Black;
                UTbxAmountPrimary.TextMode          = TextBoxMode.Number;
                UTbxAmountSecondary.TextMode        = TextBoxMode.SingleLine;
                UTbxAmountPrimary.ReadOnly          = false;
                UTbxAmountSecondary.ReadOnly        = true;
                ULBtnAssetPrimaryGlyph.LabelClass   = label_lock;
                ULBtnAssetSecondaryGlyph.LabelClass = label_edit;
            }

            if (SManager.AssetSecondary.IsFixed)
            {
                UTbxAmountSecondary.ForeColor       = System.Drawing.Color.Black;
                UTbxAmountPrimary.TextMode          = TextBoxMode.SingleLine;
                UTbxAmountSecondary.TextMode        = TextBoxMode.Number;
                UTbxAmountPrimary.ReadOnly          = true;
                UTbxAmountSecondary.ReadOnly        = false;
                ULBtnAssetPrimaryGlyph.LabelClass   = label_edit;
                ULBtnAssetSecondaryGlyph.LabelClass = label_lock;
            }

            if (update)
            {
                ULBtnAssetPrimaryGlyph.Update();
                ULBtnAssetSecondaryGlyph.Update();
                UTbxAmountPrimaryReset(true);
                UTbxAmountSecondaryReset(true);
            }
        }
 /// <summary>
 /// Updates all update panels
 /// </summary>
 public void UpdateAllPanells()
 {
     URbtnAssetPrimaryBuy.Update();
     URbtnAssetPrimarySell.Update();
     URbtnAssetSecondaryBuy.Update();
     URbtnAssetSecondarySell.Update();
     ULBtnAssetPrimaryGlyph.Update();
     ULBtnAssetSecondaryGlyph.Update();
     UDdlCurrencyPrimary.Update();
     UDdlCurrencySecondary.Update();
     UTbxAmountPrimary.Update();
     UTbxAmountSecondary.Update();
 }