public DDHotkeyManager() { _phonenumbergrabber = new PhonenumberGrabber(); _hotkeymanager = new HotKeyManager(); _hotkeys = new Dictionary <DDHotkeyType, DDHotkey>(); _hotkeytypelookup = new Dictionary <DDHotkey, DDHotkeyType>(); _hotkeymanager.KeyPressed += _hotkeymanager_KeyPressed; }
public MainForm() { InitializeComponent(); _autoreconnect = false; _isexiting = false; _client = new Fop2FatClient(); _hotkeymanager = new HotKeyManager(); _hotkeymanager.KeyPressed += hotkeymanager_KeyPressed; _phonenumbergrabber = new PhonenumberGrabber(); hotkeyComboBox.DataSource = Enum.GetValues(typeof(si.Key)).Cast <si.Key>(); this.SetTrayStatus(null); var settings = Properties.Settings.Default; this.hostTextBox.Text = settings.Host; this.portTextBox.Text = settings.Port.ToString(); this.usernameTextBox.Text = settings.Username; this.passwordTextBox.Text = settings.Password; this.contextTextBox.Text = settings.PBXContext; this.pingIntervalTextBox.Text = settings.PingInterval.ToString(); this.fop2WebInterfaceTextBox.Text = settings.FOP2Url; hotkeyComboBox.SelectedItem = (si.Key)settings.Hotkey; hotkeyAltCheckBox.Checked = (settings.HotkeyModifiers & (int)si.ModifierKeys.Alt) != 0; hotkeyCtrlCheckBox.Checked = (settings.HotkeyModifiers & (int)si.ModifierKeys.Control) != 0; hotkeyWinCheckBox.Checked = (settings.HotkeyModifiers & (int)si.ModifierKeys.Windows) != 0; hotkeyShiftCheckBox.Checked = (settings.HotkeyModifiers & (int)si.ModifierKeys.Shift) != 0; _client.ConnectionError += _client_ConnectionError; _client.ConnectionStateChanged += _client_ConnectionStateChanged; _client.AuthenticationResultReceived += _client_AuthenticationResultReceived; this.Connect(); }