Beispiel #1
0
        public FluentSessionRecorder Focus(IElement element)
        {
            var command = new FocusCommand(element);

            _performer.Perform(command);

            return(this);
        }
Beispiel #2
0
        public FluentSessionRecorder Focus(string selector)
        {
            var command = new FocusCommand(selector);

            _performer.Perform(command);

            return(this);
        }
        protected override void OnKeyUp(string text, char key, int caret, KeyEventArgs e)
        {
            Items?.Clear();

            var word       = GetCaretWord(text, caret).ToLower();
            var snipetKeys = GetSnipetKeys(word);

            bool isCursor = e.Key == Key.Left || e.Key == Key.Right;
            bool isBlock  = ScriptIndentAnalyze(text, caret).isScriptBlock;

            if (isBlock && !isCursor)
            {
                var blocks = CsTxt.Block.BlockFactory.Parse(text);
                var usings = blocks.OfType <UsingBlock>().Select(x => x.GetNamespace()).ToArray();
                foreach (var name in DotNet.GetTypes(usings, word))
                {
                    Items?.Add(name);
                }
            }

            foreach (var snipetKey in snipetKeys)
            {
                if (!string.IsNullOrWhiteSpace(snipetKey))
                {
                    Items?.Add(snipetKey);
                }
            }

            if (e.Key == Key.Down || e.Key == Key.Up || e.Key == Key.Left || e.Key == Key.Right)
            {
                if (0 < (Items?.Count ?? 0))
                {
                    FocusCommand?.Execute(null);
                }
            }
        }
Beispiel #4
0
 public void SetUp()
 {
     _defaultCommand = new FocusCommand(DefaultSelector);
 }
 private void DatePicker_Unfocused(object sender, FocusEventArgs e)
 {
     FocusCommand?.Execute(datePicker.IsFocused);
     Unfocused?.Invoke(this, e);
 }
 private void DatePicker_Focused(object sender, FocusEventArgs e)
 {
     _wasFocused = true;
     FocusCommand?.Execute(datePicker.IsFocused);
     Focused?.Invoke(this, e);
 }