Esempio n. 1
0
        public void SetMode(UserControlMode mode)
        {
            this.mode = mode;
            // скрыть определенные поля в определенном режиме
            if (mode == UserControlMode.Edit)
            {
                cbDepoSize.Enabled        = false;
                cbCurrency.Visible        = false;
                lblCurreny.Visible        = false;
                btnComplete.Text          = Localizer.GetString("TitleEdit");
                tbPassword.Visible        = true;
                lblPassword.Visible       = true;
                additionalTabPage.Enabled = true;
                try
                {
                    var metadataSettings = TradeSharpDictionary.Instance.proxy.GetMetadataByCategory("UserInfoEx");
                    if (metadataSettings != null)
                    {
                        var bigSize = (int)metadataSettings["BigAvatarMaxSize"];
                        bigAvatarPanel.Width  = bigSize;
                        bigAvatarPanel.Height = bigSize;
                        var smallSize = (int)metadataSettings["SmallAvatarMaxSize"];
                        smallAvatarPanel.Width  = smallSize;
                        smallAvatarPanel.Height = smallSize;
                    }
                }
                catch (Exception ex)
                {
                    Logger.Info("UserInfoControl.SetMode: server error", ex);
                }
                tabPageService.Enabled = true;
            }
            else
            {
                // режим открытия счета
                tbPassword.Visible        = EnablePasswordOnRegistration;
                lblPassword.Visible       = EnablePasswordOnRegistration;
                additionalTabPage.Enabled = false;

                tabPageService.Enabled = false;
            }
        }
            public void SetUserControlMode(UserControlMode _userControlMode)
            {
                userControlMode = _userControlMode;

                currentUIConnection = new Dictionary <int, UIConnection>();
            }
Esempio n. 3
0
        public void SetMode(UserControlMode mode)
        {
            this.mode = mode;
            // скрыть определенные поля в определенном режиме
            if (mode == UserControlMode.Edit)
            {
                cbDepoSize.Enabled = false;
                cbCurrency.Visible = false;
                lblCurreny.Visible = false;
                btnComplete.Text = Localizer.GetString("TitleEdit");
                tbPassword.Visible = true;
                lblPassword.Visible = true;
                additionalTabPage.Enabled = true;
                try
                {

                    var metadataSettings = TradeSharpDictionary.Instance.proxy.GetMetadataByCategory("UserInfoEx");
                    if (metadataSettings != null)
                    {
                        var bigSize = (int)metadataSettings["BigAvatarMaxSize"];
                        bigAvatarPanel.Width = bigSize;
                        bigAvatarPanel.Height = bigSize;
                        var smallSize = (int)metadataSettings["SmallAvatarMaxSize"];
                        smallAvatarPanel.Width = smallSize;
                        smallAvatarPanel.Height = smallSize;
                    }
                }
                catch (Exception ex)
                {
                    Logger.Info("UserInfoControl.SetMode: server error", ex);
                }
                tabPageService.Enabled = true;
            }
            else
            {
                // режим открытия счета
                tbPassword.Visible = EnablePasswordOnRegistration;
                lblPassword.Visible = EnablePasswordOnRegistration;
                additionalTabPage.Enabled = false;

                tabPageService.Enabled = false;
            }
        }