Ejemplo n.º 1
0
        private void hotkeymanager_KeyPressed(object sender, KeyPressedEventArgs e)
        {
            var numbers = _phonenumbergrabber.TryGrabPhonenumbersFromSelection(6);  //TODO: Make this minlength a setting?

            if (numbers.Length == 0)
            {
                return;                 //Nothing to do...
            }
            string dialnumber = null;

            if (numbers.Length == 1)
            {
                dialnumber = numbers[0];
            }
            else
            {
                using (var s = new SelectNumber(numbers))
                {
                    if (s.ShowDialog(this) == DialogResult.OK)
                    {
                        dialnumber = s.SelectedNumber;
                    }
                }
            }

            if (dialnumber != null)
            {
                _client.Dial(dialnumber);
            }
        }
Ejemplo n.º 2
0
        private void _hotkeymanager_KeyPressed(object sender, KeyPressedEventArgs e)
        {
            var kp = new DDHotkey(e.HotKey);

            if (_hotkeytypelookup.ContainsKey(kp))
            {
                switch (_hotkeytypelookup[kp])
                {
                case DDHotkeyType.DialSelectionFromActiveWindow:
                    var numbers = _phonenumbergrabber.TryGrabPhonenumbersFromSelection(Properties.Settings.Default.GrabMinLength);
                    if (numbers.Length > 0)
                    {
                        DialRequest(this, new DialRequestEventArgs(numbers));
                    }
                    break;
                }
            }
        }