Ejemplo n.º 1
0
        public MainPage()
        {
            InitializeComponent();
            _viewModel = App.MainViewModel;

            try
            {
                _translationService  = new TranslationService();
                _conversationService = new ConversationService();

                // Get the instance of LyncClient and subscribe to outgoing/incoming conversation events
                _lyncClient = LyncClient.GetClient();
                _lyncClient.StateChanged += new EventHandler <ClientStateChangedEventArgs>(LyncClient_StateChanged);

                _conversation = (Conversation)Microsoft.Lync.Model.LyncClient.GetHostingConversation();

                // Perform run-time registration using the ApplicationRegistration class.
                _myApplicationRegistration = _lyncClient.CreateApplicationRegistration(App.AppId, App.AppName);
                this._myApplicationRegistration.AddRegistration();
            }
            catch (ClientNotFoundException) { Console.WriteLine("Lync client was not found on startup"); }
            catch (LyncClientException lce) { MessageBox.Show("Lyncclientexception: " + lce.Message); }
        }
Ejemplo n.º 2
0
        public MainPage()
        {
            InitializeComponent();
            _viewModel = App.MainViewModel;

            try
            {
                _translationService = new TranslationService();
                _conversationService = new ConversationService();

                // Get the instance of LyncClient and subscribe to outgoing/incoming conversation events
                _lyncClient = LyncClient.GetClient();
                _lyncClient.StateChanged += new EventHandler<ClientStateChangedEventArgs>(LyncClient_StateChanged);

                _conversation = (Conversation)Microsoft.Lync.Model.LyncClient.GetHostingConversation();

                // Perform run-time registration using the ApplicationRegistration class.
                _myApplicationRegistration = _lyncClient.CreateApplicationRegistration(App.AppId, App.AppName);
                this._myApplicationRegistration.AddRegistration();
            }
            catch (ClientNotFoundException) { Console.WriteLine("Lync client was not found on startup"); }
            catch (LyncClientException lce) { MessageBox.Show("Lyncclientexception: " + lce.Message); }
        }