Ejemplo n.º 1
0
        private void GestureParser_GestureCaptured(Gesture gesture)
        {
            if (gesture.Count() == 0 && gesture.Modifier == GestureModifier.None)
            {
                return;
            }
            Debug.WriteLine("GestureCaptured: " + gesture);
            var formerMnemonic = lb_mnemonic.Text;

            CapturedGesture = gesture;
            //if (_intent != null)
            {
                var found = _app.Find(gesture);

                if (found != null && (found != _intent))
                {
                    lb_errMsg.Text    = "相同手势(" + found.Name + ")已存在,点击‘保存’会将其替代";
                    flowAlert.Visible = true;
                }
                else
                {
                    flowAlert.Visible = false;
                }
            }

            lb_mnemonic.Text = gesture.ToString();

            if (formerMnemonic == tb_gestureName.Text || string.IsNullOrEmpty(tb_gestureName.Text))
            {
                tb_gestureName.Text = lb_mnemonic.Text;
                tb_gestureName.SelectAll();
                tb_gestureName.Focus();
            }
            else
            {
                btnOk.Focus();
            }

            btnOk.Enabled = true;
        }