Beispiel #1
0
 private void _btnSendString_Click(object sender, EventArgs e)
 {
     ExecuteActionHelper.ExecuteAction(delegate()
     {
         FormsManager.OpenForm(typeof(SendStringForm), null);
     });
 }
Beispiel #2
0
 private void _btnDiagnostics_Click(object sender, EventArgs e)
 {
     ExecuteActionHelper.ExecuteAction(delegate()
     {
         FormsManager.OpenForm(typeof(DiagnosticsForm), null);
     });
 }
Beispiel #3
0
 private void _btnPhoneMain_Click(object sender, EventArgs e)
 {
     ExecuteActionHelper.ExecuteAction(delegate()
     {
         FormsManager.OpenForm(typeof(SoftPhoneForm), null);
     });
 }
Beispiel #4
0
 private void _btnRegister_Click(object sender, EventArgs e)
 {
     ExecuteActionHelper.ExecuteAction(delegate()
     {
         FormsManager.OpenForm(typeof(RegisterForm), null);
     });
 }
Beispiel #5
0
 private void _btnConfigure_Click(object sender, EventArgs e)
 {
     ExecuteActionHelper.ExecuteAction(delegate()
     {
         FormsManager.OpenForm(typeof(ConfigurationForm), null);
     });
 }
Beispiel #6
0
        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);
                    }
                }
            });
        }
Beispiel #7
0
 private static void form_Activated(object sender, EventArgs e)
 {
     ExecuteActionHelper.ExecuteAction(delegate()
     {
         ActivateDeactivateForm(sender, true);
     });
 }
Beispiel #8
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Configuration = new SipServerConfiguration();

            ExecuteActionHelper.ExecuteAction(delegate()
            {
                FormsManager.Configure(this, _toolStripOpenedForms);
            });
        }
Beispiel #9
0
 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));
     });
 }
Beispiel #10
0
        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);
            });
        }
Beispiel #11
0
        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();
            });
        }
Beispiel #12
0
        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;
        }