Beispiel #1
0
        public MainWindow(SoftphoneEngine model)
        {
            Model = model;

            KeepAliveValues = new List <KeepAliveMode>();
            var keelAliveValues = Enum.GetValues(typeof(KeepAliveMode));

            foreach (KeepAliveMode mode in keelAliveValues)
            {
                KeepAliveValues.Add(mode);
            }

            VideoQualities = new List <VideoQuality>();
            var qualities = Enum.GetValues(typeof(VideoQuality));

            foreach (VideoQuality quality in qualities)
            {
                VideoQualities.Add(quality);
            }
            VideoEncoderQuality = VideoQuality.High;

            InitializeComponent();

            CustomHeight = 550;

            Model.PhoneLineStateChanged += (Model_PhoneLineStateChanged);
            Model.PhoneCallStateChanged += (Model_PhoneCallStateChanged);
            //Model.MessageSummaryReceived += (Model_MessageSummaryReceived);
            //Model.NatDiscoveryFinished += (Model_NatDiscoveryFinished);
            //Model.CallInstantMessageReceived += (Model_CallInstantMessageReceived);
            Model.MediaHandlers.MicrophoneStopped += MediaHandlers_MicrophoneStopped;
            Model.MediaHandlers.SpeakerStopped    += MediaHandlers_SpeakerStopped;
        }
Beispiel #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            try
            {
                AppDomain.CurrentDomain.UnhandledException       += CurrentDomain_UnhandledException;
                Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;

                SoftphoneEngine model = new SoftphoneEngine();

                Phone window = new Phone(model);
                window.Show();
            }
            catch (Exception ex)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("Could not initialize softphone: \r\n");
                sb.Append(ex.Message);
                sb.Append("\r\n");
                sb.Append(ex.InnerException);
                sb.Append(ex.StackTrace);
                MessageBox.Show(sb.ToString(), "Reliance Ozeki", MessageBoxButton.OK, MessageBoxImage.Error);
                Application.Current.Shutdown();
            }
            base.OnStartup(e);
        }
Beispiel #3
0
        public Phone(SoftphoneEngine model)
        {
            Model = model;
            InitializeComponent();

            Model.PhoneLineStateChanged           += (Model_PhoneLineStateChanged);
            Model.PhoneCallStateChanged           += (Model_PhoneCallStateChanged);
            Model.MessageSummaryReceived          += (Model_MessageSummaryReceived);
            Model.NatDiscoveryFinished            += Model_NatDiscoveryFinished;
            Model.CallInstantMessageReceived      += (Model_CallInstantMessageReceived);
            Model.MediaHandlers.MicrophoneStopped += MediaHandlers_MicrophoneStopped;
            Model.MediaHandlers.SpeakerStopped    += MediaHandlers_SpeakerStopped;

            //txtCallStatus.Text = Model.callState.ToString();
        }
Beispiel #4
0
        protected override void OnStartup(StartupEventArgs e)
        {
            try
            {
                SoftphoneEngine model  = new SoftphoneEngine();
                MainWindow      window = new MainWindow(model);
                window.Show();
            }
            catch (Exception ex)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("Could not initialize softphone: \r\n");
                sb.Append(ex.Message);
                sb.Append("\r\n");
                sb.Append(ex.InnerException);
                sb.Append(ex.StackTrace);
                MessageBox.Show(sb.ToString());
                Application.Current.Shutdown();
            }

            base.OnStartup(e);
        }
Beispiel #5
0
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                //Application.Run(new ViewForm());
                //Application.Run(new RandomEventViewForm());

                SoftphoneEngine softPhone = SoftphoneEngine.Instance;
                MainForm        mainForm  = new MainForm(softPhone);
                Application.Run(mainForm);
            }
            catch (Exception e)
            {
                var sb = new StringBuilder();
                sb.AppendLine("Some error happened.");
                sb.AppendLine();
                sb.AppendLine("Exception:");
                sb.AppendLine(e.Message);
                sb.AppendLine();
                if (e.InnerException != null)
                {
                    sb.AppendLine("Inner Exception:");
                    sb.AppendLine(e.InnerException.Message);
                    sb.AppendLine();
                }
                sb.AppendLine("StackTrace:");
                sb.AppendLine(e.StackTrace);

                MessageBox.Show(sb.ToString());
            }
            finally
            {
                Application.Exit();
            }
        }
Beispiel #6
0
 public ForwardCallForm(SoftphoneEngine softphoneEngine)
 {
     this.softphoneEngine = softphoneEngine;
     InitializeComponent();
     tbxForwardTo.Text = softphoneEngine.ForwardCallTo;
 }
        public MainWindow()
        {
            try
            {
                ModelList = new ObservableList <Camera>();

                AccountModel = new AccountModel
                {
                    RegistrationRequired = true
                };

                try
                {
                    SoftPhone = new SoftphoneEngine();
                    SoftPhone.Softphone.IncomingCall += Softphone_IncomingCall;
                }
                catch (Exception ex)
                {
                }

                Server = new MyServer();
                Server.ClientCountChange += _server_ClientCountChange;

                ConnectModel              = new ConnectModel();
                ConnectModel.DeviceAdded += ConnectModel_DeviceAdded;

                InitializeComponent();

                ConnectModel.DiscoverDevices();

                _imageSliders = new List <ImageSetting>
                {
                    BrightnessSlider,
                    ContrastSlider,
                    SaturationSlider,
                    SharpnessSlider,
                    BackLightSlider,
                    WhiteBalanceCbSlider,
                    WhiteBalanceCrSlider,
                    FrameRateSlider
                };

                _videoViewerList = new List <CameraViewerControl>
                {
                    Viewer1,
                    Viewer2,
                    Viewer3,
                    Viewer4
                };

                UseUTC = true;
                OnPropertyChanged("UseUTC");
                SelectedDate = DateTime.Now;
                OnPropertyChanged("SelectedDate");
            }
            catch (Exception e)
            {
                MessageBox.Show(string.Format("Error occurred: {0}, {1}", e.GetType(), e.Message));
                Environment.Exit(-1);
            }
        }