예제 #1
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            Keys keyCode = e.KeyCode;

            if (e.Modifiers == Keys.None)
            {
                if ((keyCode == Keys.Delete) || (keyCode == Keys.Back))
                {
                    if (!string.IsNullOrEmpty(searchText))
                    {
                        searchText = searchText.Remove(searchText.Length - 1);
                    }
                    Research();
                }
            }
            if (e.Control && char.IsLetter((char)((ushort)keyCode)))
            {
                switch (keyCode)
                {
                case Keys.V:
                    if (Clipboard.ContainsText())
                    {
                        searchText = Clipboard.GetText();
                        Research();
                    }
                    break;

                case Keys.C:
                    if ((Items.Count > 0) && (SelectedItem > -1))
                    {
                        FileOperations.CopyFilesListToClipboard(new string[1] {
                            Items[SelectedItem].FileName
                        });
                    }
                    break;

                default:
                    break;
                }
            }
            base.OnKeyDown(e);
        }