private void _btnSendString_Click(object sender, EventArgs e) { ExecuteActionHelper.ExecuteAction(delegate() { FormsManager.OpenForm(typeof(SendStringForm), null); }); }
private void _btnDiagnostics_Click(object sender, EventArgs e) { ExecuteActionHelper.ExecuteAction(delegate() { FormsManager.OpenForm(typeof(DiagnosticsForm), null); }); }
private void _btnPhoneMain_Click(object sender, EventArgs e) { ExecuteActionHelper.ExecuteAction(delegate() { FormsManager.OpenForm(typeof(SoftPhoneForm), null); }); }
private void _btnRegister_Click(object sender, EventArgs e) { ExecuteActionHelper.ExecuteAction(delegate() { FormsManager.OpenForm(typeof(RegisterForm), null); }); }
private void _btnConfigure_Click(object sender, EventArgs e) { ExecuteActionHelper.ExecuteAction(delegate() { FormsManager.OpenForm(typeof(ConfigurationForm), null); }); }
private static void formClosed(object sender, FormClosedEventArgs e) { ExecuteActionHelper.ExecuteAction(delegate() { BaseForm form = sender as BaseForm; if (form == null) { return; } // remove tool strip button item. ToolStripItem item = m_openedWindowToolStrip.Items[MakeToolBarItemName(form)]; if (item != null) { m_openedWindowToolStrip.Items.Remove(item); } if (form.Key != null) { // check if it is a multiple opened form and remove it. if (m_multipleOpenedForms.ContainsKey(form.Key)) { m_multipleOpenedForms.Remove(form.Key); } } }); }
private static void form_Activated(object sender, EventArgs e) { ExecuteActionHelper.ExecuteAction(delegate() { ActivateDeactivateForm(sender, true); }); }
private void MainForm_Load(object sender, EventArgs e) { Configuration = new SipServerConfiguration(); ExecuteActionHelper.ExecuteAction(delegate() { FormsManager.Configure(this, _toolStripOpenedForms); }); }
public new void Handle(Exception e) { //create the from, or bring it to front this.OnUIThread(() => { ExecuteActionHelper.ExecuteAction(delegate() { FormsManager.OpenForm(typeof(ErrorForm), null); }); EventAggregator.Instance.Publish(new ExceptionEvent(e)); }); }
void MainForm_Load(object sender, EventArgs e) { _lblPID.Text = string.Format("PID:{0}", Process.GetCurrentProcess().Id); Configuration = new ClientConfiguration(); var localIp4Address = Dns.GetHostAddresses(string.Empty).FirstOrDefault(a => a.AddressFamily == AddressFamily.InterNetwork); Configuration.OutboundProxyIpEndPoint = localIp4Address + ":33333"; Configuration.BindIpEndPoint = localIp4Address + ":" + (22220 + ProcessLogic.CountProcessesByName(Process.GetCurrentProcess().ProcessName)); ExecuteActionHelper.ExecuteAction(delegate() { FormsManager.Configure(this, _toolStripOpenedForms); }); }
private static void item_Click(object sender, EventArgs e) { ExecuteActionHelper.ExecuteAction(delegate() { ToolStripButton item = sender as ToolStripButton; if (item == null) { return; } BaseForm form = item.Tag as BaseForm; if (form == null) { return; } form.BringToFront(); }); }
private void _btnStartStop_Click(object sender, EventArgs e) { if (!_isStarted) { var ipEndPoint = SipUtil.ParseIpEndPoint(Configuration.BindIpEndPoint); var outboundProxy = SipUtil.ParseIpEndPoint(Configuration.OutboundProxyIpEndPoint); SipStack = new SipStack(); var listeningPoint = SipStack.CreateUdpListeningPoint(ipEndPoint); SipStack.MaxWorkerThreads = Configuration.MaxThreadPoolSize; SipStack.MinWorkerThreads = Configuration.MinThreadPoolSize; SipStack.OutBoundProxy = outboundProxy; SipStack.EnableThreadPoolPerformanceCounters = Configuration.EnableThreadPoolPerformanceCounters; //SipStack.IsStateFull = Configuration.IsStateFull; SipProvider = (SipProvider)SipStack.CreateSipProvider(listeningPoint); MainSipListener = new SipPipeLineListener(this); SipProvider.AddSipListener(MainSipListener); SipProvider.AddExceptionHandler(this); SipProvider.Start(); HeaderFactory = SipStack.CreateHeaderFactory(); MessageFactory = SipStack.CreateMessageFactory(); AddressFactory = SipStack.CreateAddressFactory(); ExecuteActionHelper.ExecuteAction(delegate() { FormsManager.OpenForm(typeof(LogForm), null); }); _lblIpAddress.Text = string.Format("IP:{0}", ipEndPoint.ToString()); } else { SipProvider.Stop(); } _isStarted = !_isStarted; _btnStartStop.Text = _isStarted ? "Stop" : "Start"; _grbNavigation.Enabled = _isStarted; }