public DDCore() { _client = new Fop2FatClient(); _hotkeymanager = new DDHotkeyManager(); _connectionmanager = new DDConnectionManager(_client); _fop2webinterface = new ToolStripMenuItem(Properties.Resources.menu_fop2web, Properties.Resources.ico_world_go.ToBitmap(), event_WebInterface); _fop2userportal = new ToolStripMenuItem(Properties.Resources.menu_fop2userportal, Properties.Resources.ico_world_go.ToBitmap(), event_WebInterface); _notifyicon = new DDNotifyIcon(_client); _notifyicon.ContextMenuStrip = DDNotifyIcon.CreateDefaultContextMenu(event_OnSettings, event_OnAbout, event_OnExit); _notifyicon.ContextMenuStrip.Items.Insert(0, _fop2userportal); _notifyicon.ContextMenuStrip.Items.Insert(1, _fop2webinterface); _notifyicon.ContextMenuStrip.Opening += event_ContextMenuStripOpening; _notifyicon.BalloonClicked += event_BalloonClicked; _hotkeymanager.DialRequest += event_DialRequest; _connectionmanager.RegisterListener(_notifyicon); _pipeserver = new DDPipeServer(); _pipeserver.MessageReceived += (s, e) => { this.DialFromCommandlineArgs(e.Data.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries)); }; _pipeserver.Listen(GetIPCPipeName()); }
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(); }