System.Collections.Generic.List.Add(vKey)

Here are the examples of the csharp api System.Collections.Generic.List.Add(vKey) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 View Source File : TypeText.cs
License : Mozilla Public License 2.0
Project Creator : open-rpa

public void AddKey(vKey _key, System.Activities.Presentation.Model.ModelItem lastinsertedmodel)
        {
            if (_keys == null) _keys = new List<vKey>();
            if (!_key.up)
            {
                var isdown = _downkeys.Where(x => x.KeyCode == _key.KeyCode).FirstOrDefault();
                if (isdown != null) return;
                _downkeys.Add(_key);
            }
            else
            {
                var isdown = _downkeys.Where(x => x.KeyCode == _key.KeyCode).FirstOrDefault();
                if (isdown == null) return;
                _downkeys.Remove(isdown);

            }

            _keys.Add(_key);
            result = "";
            for (var i = 0; i < _keys.Count; i++)
            {
                string val = "";
                var key = _keys[i];
                if (key.up == false && (i + 1) < _keys.Count)
                {
                    if (key.KeyCode == _keys[i + 1].KeyCode && _keys[i + 1].up)
                    {
                        i++;
                        val = "{" + key.KeyCode.ToString() + "}";
                        if (key.KeyCode.ToString().StartsWith("KEY_"))
                        {
                            val = key.KeyCode.ToString().Substring(4).ToLower();
                        }
                        if (key.KeyCode == FlaUI.Core.WindowsAPI.VirtualKeyShort.SPACE)
                        {
                            val = " ";
                        }
                    }
                }
                if (string.IsNullOrEmpty(val))
                {
                    if (key.up == false)
                    {
                        val = "{" + key.KeyCode.ToString() + " down}";
                    }
                    else
                    {
                        val = "{" + key.KeyCode.ToString() + " up}";
                    }

                }
                result += val;
            }
            //Text = result;
            if (result == null) result = "";
            if (lastinsertedmodel != null) lastinsertedmodel.Properties["Text"].SetValue(new InArgument<string>(result));
        }