Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="owner"></param>
        /// <param name="lastTypedUserName"></param>
        /// <param name="windowTitle"></param>
        /// <param name="groupTitle">if not null - set as the group's title (inside the form).</param>
        /// <param name="msgCaption">if not null - set as a message inside the form.</param>
        public AuthenticationForm(AuthenticationDialogHandler owner, String lastTypedUserName, String windowTitle,
                                  String groupTitle, String msgCaption)
        {
            InitializeComponent();
            _owner = owner;
            textBoxUsername.Text = lastTypedUserName;
            Text = windowTitle;
            if (groupTitle != null)
            {
                groupBox1.Text = groupTitle;
            }
            if (msgCaption != null)
            {
                labelInstructions.Text = msgCaption;
            }

            // logon window should be shown RightToLeft
            if (MgEvents.IsLogonRTL())
            {
                this.RightToLeft       = RightToLeft.Yes;
                this.RightToLeftLayout = true;

                // Layout of controls inside groupBox isn't changed if RTL is Yes. So change layout only for controls inside
                // group box. Rest controls layout will be handled automatically by form.
                ApplyRTL(this);

                if (MgEvents.IsSpecialEngLogon())
                {
                    textBoxUsername.RightToLeft = RightToLeft.No;
                    textBoxPassword.RightToLeft = RightToLeft.No;
                }
            }
            labelUsername.Text     = MgEvents.GetMessageString(MsgInterface.STR_USER_ID);
            labelPassword.Text     = MgEvents.GetMessageString(MsgInterface.STR_PASSWORD);
            labelInstructions.Text = MgEvents.GetMessageString(MsgInterface.STR_LOGON_INSTRUCTION);
            buttonOK.Text          = MgEvents.GetMessageString(MsgInterface.GUI_OK_BUTTON);
            buttonCancel.Text      = MgEvents.GetMessageString(MsgInterface.GUI_CANCEL_BUTTON);
        }