示例#1
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            _host = new ServiceHost(this);
            _host.AddServiceEndpoint(typeof(IIncomingCallService), new NetNamedPipeBinding(NetNamedPipeSecurityMode.None), "net.pipe://localhost/IncomingCallService");
            _host.Open();

            if (!Process.GetProcessesByName("3CXWin8Phone").Any())
            {
                string path3CX = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), @"3CXPhone for Windows\PhoneApp\3CXWin8Phone.exe");
                if (File.Exists(path3CX))
                {
                    ProcessStartInfo startInfo = new ProcessStartInfo(path3CX)
                    {
                        WindowStyle = ProcessWindowStyle.Minimized
                    };
                    Process.Start(startInfo);
                }
            }

            _makeCallChannelFactory = new ChannelFactory <IMakeCallService>(new NetNamedPipeBinding(NetNamedPipeSecurityMode.None), "net.pipe://localhost/MakeCallService");

            IMakeCallService makeCallService = _makeCallChannelFactory.CreateChannel();

            lbl3CX.Visible = makeCallService.Hello();
            StatusChanged(makeCallService.Status());
        }
示例#2
0
        private void cmdHangUp_Click(object sender, EventArgs e)
        {
            IMakeCallService makeCallService = _makeCallChannelFactory.CreateChannel();

            makeCallService.HangUp(_status.CallId);
        }
示例#3
0
        private void cmdCall_Click(object sender, EventArgs e)
        {
            IMakeCallService makeCallService = _makeCallChannelFactory.CreateChannel();

            makeCallService.MakeCall(txtNumber.Text.Trim());
        }