public void RegisterSipAccount(AccountModel model)
		{
		    try
		    {
                if (model == null)
                    return;

		        if (PhoneLine != null)
		        {
                    PhoneLine.RegistrationStateChanged -= phoneLine_RegistrationStateChanged;
		        }

		        var account = new SIPAccount(model.RegistrationRequired, model.DisplayName, model.UserName, model.RegisterName, model.Password, model.Domain, model.OutboundProxy);
                PhoneLine = Softphone.CreatePhoneLine(account);
                PhoneLine.RegistrationStateChanged += phoneLine_RegistrationStateChanged;
                Softphone.RegisterPhoneLine(PhoneLine);
                Log.Write(string.Format("Registering phone line " + model.UserName));
		    }
		    catch (Exception exception)
		    {
                Log.Write("Error during SIP registration: " + exception.Message);
                MessageBox.Show("Error during SIP registration: " + exception.Message);
		    }
		}
 public SIPAccount(AccountModel model)
 {
     Model = model;
     InitializeComponent();
 }
        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);
            }
        }
 public SipAccountWindow(AccountModel model)
 {
     Model = model;
     InitializeComponent();
 }