コード例 #1
0
        public SessionWindow(String remotePartyUri)
            : base()
        {
            InitializeComponent();

            this.remotePartyUri = remotePartyUri;
            this.Title = String.Empty;
            this.buttonCallOrAnswer.Tag = Strings.Text_Call;

            this.fileTransferSessions = new List<MyMsrpSession>();
            this.imActivityIndicator = new IMActivityIndicator(this.remotePartyUri);

            this.videoDisplayLocal = new VideoDisplay();
            this.videoDisplayLocal.VerticalAlignment = VerticalAlignment.Stretch;
            this.videoDisplayLocal.HorizontalAlignment = HorizontalAlignment.Stretch;
            this.videoDisplayScrenCastLocal = new VideoDisplay();
            this.videoDisplayScrenCastLocal.VerticalAlignment = this.videoDisplayLocal.VerticalAlignment;
            this.videoDisplayScrenCastLocal.HorizontalAlignment = this.videoDisplayLocal.HorizontalAlignment;
            this.videoDisplayRemote = new VideoDisplay();
            this.videoDisplayRemote.ToolTip = this.borderVideoDispalyRemote.ToolTip;

            this.borderVideoDispalyRemote.Child = this.videoDisplayRemote;
            this.borderVideoDispalyLocal.Child = this.videoDisplayLocal;
            this.borderVideoDispalyScrenCastLocal.Child = this.videoDisplayScrenCastLocal;

            this.labelInfo.Content = String.Empty;
            this.timerCall = new Timer(1000);
            this.timerCall.AutoReset = true;
            this.timerCall.Elapsed += this.timerCall_Elapsed;

            // Services
            this.contactService = Win32ServiceManager.SharedManager.ContactService;
            this.sipService = Win32ServiceManager.SharedManager.SipService;
            this.historyService = Win32ServiceManager.SharedManager.HistoryService;
            this.soundService = Win32ServiceManager.SharedManager.SoundService;
            this.configurationService = Win32ServiceManager.SharedManager.ConfigurationService;

            // Messaging
            this.historyDataSource = new MyObservableCollection<HistoryEvent>();
            this.historyCtrl.ItemTemplateSelector = new DataTemplateSelectorMessaging();
            this.historyCtrl.ItemsSource = this.historyDataSource;

            // Register events
            this.sipService.onInviteEvent += this.sipService_onInviteEvent;
            this.imActivityIndicator.RemoteStateChangedEvent += this.imActivityIndicator_RemoteStateChangedEvent;
            this.imActivityIndicator.SendMessageEvent += this.imActivityIndicator_SendMessageEvent;

            this.volume = this.configurationService.Get(Configuration.ConfFolder.GENERAL, Configuration.ConfEntry.AUDIO_VOLUME, Configuration.DEFAULT_GENERAL_AUDIO_VOLUME);
            this.sliderVolume.Value = (double)this.volume;

            lock (SessionWindow.windows)
            {
                SessionWindow.windows.Add(this);
            }
        }
コード例 #2
0
ファイル: SessionWindow.xaml.cs プロジェクト: xolile/boghe
        public SessionWindow(String remotePartyUri)
            : base()
        {
            InitializeComponent();

            this.remotePartyUri = remotePartyUri;
            this.Title = String.Empty;
            this.buttonCallOrAnswer.Tag = "Call";

            this.fileTransferSessions = new List<MyMsrpSession>();

            this.videoDisplayLocal = new VideoDisplay();
            this.videoDisplayLocal.Visibility = Visibility.Hidden;
            this.videoDisplayRemote = new VideoDisplay();
            this.videoDisplayRemote.Visibility = Visibility.Hidden;
            this.videoDisplayRemote.ToolTip = this.borderVideoDispalyRemote.ToolTip;

            this.borderVideoDispalyRemote.Child = this.videoDisplayRemote;
            this.borderVideoDispalyLocal.Child = this.videoDisplayLocal;

            this.labelInfo.Content = String.Empty;
            this.timerCall = new Timer(1000);
            this.timerCall.AutoReset = true;
            this.timerCall.Elapsed += this.timerCall_Elapsed;

            // Services
            this.contactService = Win32ServiceManager.SharedManager.ContactService;
            this.sipService = Win32ServiceManager.SharedManager.SipService;
            this.historyService = Win32ServiceManager.SharedManager.HistoryService;
            this.soundService = Win32ServiceManager.SharedManager.SoundService;
            this.configurationService = Win32ServiceManager.SharedManager.ConfigurationService;

            // Messaging
            this.historyDataSource = new MyObservableCollection<HistoryEvent>();
            this.historyCtrl.ItemTemplateSelector = new DataTemplateSelectorMessaging();
            this.historyCtrl.ItemsSource = this.historyDataSource;

            // Register to SIP events
            this.sipService.onInviteEvent += this.sipService_onInviteEvent;

            lock (SessionWindow.windows)
            {
                SessionWindow.windows.Add(this);
            }
        }