Ejemplo n.º 1
0
 private void enableButtons()
 {
     try
     {
         this.Invoke((MethodInvoker) delegate()
         {
             BtnOK.Show();
         });
         this.Invoke((MethodInvoker) delegate()
         {
             btnLogin.Hide();
         });
         this.Invoke((MethodInvoker) delegate()
         {
             txtUser.Enabled = true;
         });
         this.Invoke((MethodInvoker) delegate()
         {
             txtPassword.Enabled = true;
         });
         this.Invoke((MethodInvoker) delegate()
         {
             Refresh();
         });
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 2
0
 private void tBoxPsw_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 13)//判断回车键
     {
         BtnOK.Focus();
     }
 }
Ejemplo n.º 3
0
        private void ConfigMessage()
        {
            int LblTextLeft = LblText.Left;

            LblTitle.Text        = _Title;
            LblText.Text         = _Text;
            _formHeight          = LblText.Size.Height + 120;
            Width                = LblText.Size.Width + 100;
            LblTitle.MaximumSize = new Size(LblText.Size.Width, 24);
            LblTitle.Location    = new Point(Width / 2 - LblTitle.Width / 2, LblTitle.Location.Y);
            if (LblText.Left != LblTextLeft)
            {
                LblText.Left = LblTextLeft - 5;
            }
            if (_MT == BeheshtMBox.MessageType.YesNo)
            {
                BtnCancel.Visible = true;
                BtnCancel.Select();
            }
            else
            {
                BtnOK.Select();
            }
            switch (_Icon)
            {
            case BeheshtMBox.Icon.Info: PicBoxIcon.Image = FactoryShahin.Properties.Resources.Info;
                break;

            case BeheshtMBox.Icon.Warning: PicBoxIcon.Image = FactoryShahin.Properties.Resources.Warning;
                break;

            case BeheshtMBox.Icon.Question: PicBoxIcon.Image = FactoryShahin.Properties.Resources.Question;
                break;
            }
        }
Ejemplo n.º 4
0
 private void ExcluirCenarioPopUp()
 {
     BtnOK.EsperarElemento(Browser);
     if (Browser.PageSource("O cenário e todos os ambientes associados serão excluídos e não poderão ser recuperados. Tem certeza que deseja excluir este cenário?"))
     {
         MouseActions.ClickATM(Browser, BtnOK);
     }
 }
Ejemplo n.º 5
0
 private void ExcluirListaCenarioIncompativelPopUp()
 {
     BtnOK.EsperarElemento(Browser);
     if (Browser.PageSource("Todos os cenários incompatíveis da lista selecionada serão excluídos. Deseja continuar?"))
     {
         MouseActions.ClickATM(Browser, BtnOK);
     }
 }
Ejemplo n.º 6
0
 private void ExclusaoFotoPopUp()
 {
     if (Browser.PageSource("A exclusão desta foto irá excluir também todas as marcações associadas a esta foto. Tem certeza que deseja excluí-la?"))
     {
         BtnOK.EsperarElemento(Browser);
         MouseActions.ClickATM(Browser, BtnOK);
     }
 }
Ejemplo n.º 7
0
        protected override void RegisterUIEvent()
        {
            BtnClose.OnClickAsObservable().Subscribe(_ =>
            {
                CloseSelf();
            });

            BtnOK.OnClickAsObservable().Subscribe(_ =>
            {
                CloseSelf();
            });
        }
Ejemplo n.º 8
0
 private void TxtPassword_KeyUp(object sender, KeyEventArgs e)
 {
     switch (e.KeyCode)
     {
     case Keys.Enter:
     {
         SetPicCheck(FlagConnection.ConnectTrue);
         BtnOK.Focus();
         break;
     }
     }
 }
Ejemplo n.º 9
0
 private void TxtUserPassWord_KeyDown(object sender, KeyEventArgs e)
 {
     #region الانتقال الى الزر الدخول
     try
     {
         if (e.KeyCode == Keys.Enter && TxtUserName.Text != string.Empty)
         {
             BtnOK.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     #endregion
 }
Ejemplo n.º 10
0
        public void ChangeOwner()
        {
            SelectElement value    = new SelectElement(TeacherSelect);
            string        teacher1 = "*****@*****.**";
            string        teacher2 = "*****@*****.**";
            string        result   = OwnerParser(CurrentOwner.Text);

            if (result.Contains(teacher1))
            {
                value.SelectByText(teacher2);
            }
            else
            {
                value.SelectByText(teacher1);
            }
            BtnOK.Click();
        }
Ejemplo n.º 11
0
        public void ExcluirCenarioIncompativel(string cenario)
        {
            ExibirCenarios();

            var excluirCenario = Element.Css("div[class='panel-collapse col-md-12 collapse in'] tr:nth-child(" + cenario + ") a");

            excluirCenario.EsperarElemento(Browser);
            MouseActions.ClickATM(Browser, excluirCenario);

            var mensagemAlertaExclusao = Element.Xpath("//p[text()='O Cenário Incompatível será excluído e não poderá ser recuperado. Caso exista menos de 2 cenários incompatíveis a lista será excluída. Tem certeza que deseja excluir este Cenário Incompatível?']");

            BtnOK.EsperarElemento(Browser);
            if (mensagemAlertaExclusao.IsElementVisible(Browser))
            {
                mensagemAlertaExclusao.Esperar(Browser, 2000);
                MouseActions.ClickATM(Browser, BtnOK);
            }
        }
Ejemplo n.º 12
0
 private void FrmAdditionalDesc_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         BtnOK.PerformClick();
     }
     else if (e.KeyCode == Keys.Escape)
     {
         if (string.IsNullOrEmpty(TxtAdditionalDesc.Text.Trim().ToString()))
         {
             _AdditionalDesc = "<SPACE>";
         }
         else
         {
             _AdditionalDesc = TxtAdditionalDesc.Text.Trim().ToString();
         }
         this.Close();
     }
 }
Ejemplo n.º 13
0
        private void ShowButton()
        {
            if (mData.BtnTexts == null || mData.BtnTexts.Length < 1)
            {
                return;
            }

            if (mData.BtnTexts.Length == 1)
            {
                BtnNo.gameObject.SetActive(false);
                BtnYes.gameObject.SetActive(false);
                BtnOK.gameObject.SetActive(true);

                OKText.text = mData.BtnTexts[0];
            }
            else if (mData.BtnTexts.Length == 2)
            {
                BtnNo.gameObject.SetActive(true);
                BtnYes.gameObject.SetActive(true);
                BtnOK.gameObject.SetActive(false);

                YesText.text = mData.BtnTexts[0];
                NoText.text  = mData.BtnTexts[1];
            }

            if (mData.BtnBgImgs == null || mData.BtnBgImgs.Length < 1)
            {
                return;
            }

            if (mData.BtnBgImgs.Length == 1)
            {
                BtnOK.GetComponent <Image>().sprite = mData.BtnBgImgs[0];
            }
            else if (mData.BtnBgImgs.Length == 2)
            {
                BtnYes.GetComponent <Image>().sprite = mData.BtnBgImgs[0];
                BtnNo.GetComponent <Image>().sprite  = mData.BtnBgImgs[1];
            }
        }
Ejemplo n.º 14
0
 private void FrmTerm_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter && this.ActiveControl != Grid)
     {
         SendKeys.Send("{Tab}");
     }
     else if (e.KeyCode == Keys.Escape)
     {
         if (TxtGridRatePercent.Visible == true)
         {
             GridControlMode(false);
             TxtGridRatePercent.Enabled = false;
             TxtGridRatePercent.Visible = false;
             TxtGridAmount.Enabled      = false;
             TxtGridAmount.Visible      = false;
             Grid.Focus();
         }
         else
         {
             BtnOK.PerformClick();
         }
     }
 }
Ejemplo n.º 15
0
        ///<summary>
        ///Parameters:
        ///Title,
        ///Text,
        ///Title Color,
        ///Text Color
        ///</summary>
        public DialogResult Show(string m_title, string m_text, Color?m_title_forecolor = null, Color?m_text_color = null, bool alert = false)
        {
            LabelTitle.Text      = m_title;
            LabelTitle.ForeColor = m_title_forecolor ?? LabelTitle.ForeColor;

            LabelMessage.Text      = m_text;
            LabelMessage.ForeColor = m_text_color ?? LabelMessage.ForeColor;

            if (alert)
            {
                BtnOK.Show();
                BtnYES.Hide();
                BtnNO.Hide();
            }
            else
            {
                BtnOK.Hide();
                BtnYES.Show();
                BtnNO.Show();
            }

            return(ShowDialog());
        }
Ejemplo n.º 16
0
 public FrmChiTietTonKho()
 {
     InitializeComponent();
     BtnOK.Focus();
 }
Ejemplo n.º 17
0
 private void FormFinishConfirm_Load(object sender, EventArgs e)
 {
     BtnOK.Focus();
 }
Ejemplo n.º 18
0
 public FrmChiTietLoiNhuan()
 {
     InitializeComponent();
     BtnOK.Focus();
 }