Domanda

I am developing sample application using Lync 2010 SDK. In that application i want to capture Lync IM window resize event.

As I know Lync 2010 SDK do provides API's to capture re-size event for the Lync IM window.

The application is launched successfully and on launching an IM window i do get the Lync Conversation Added event, but after that i don't get resize event for it on resizing the same Lync IM window. Here is the code of sample application. Please review the code and let me know if something is missing.

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Lync.Model;
using Microsoft.Lync.Model.Conversation;
using Microsoft.Lync.Model.Extensibility;

namespace LyncWpfSample
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
    LyncClient _client = null;

    ConversationManager _conversationManager = null;

    Automation _automation = null;


    public Window1()
    {
        InitializeComponent();

        _client = LyncClient.GetClient();

        _conversationManager = _client.ConversationManager;

        _conversationManager.ConversationAdded += new EventHandler<ConversationManagerEventArgs>(ConversationManager_ConversationAdded);
    }

    void ConversationManager_ConversationAdded(object sender, ConversationManagerEventArgs e)
    {
        Conversation conv = e.Conversation;

        ConversationWindow convWindow = _automation.GetConversationWindow(conv);

        convWindow.NeedsSizeChange += new EventHandler<ConversationWindowNeedsSizeChangeEventArgs>(Conversation_convWindow_NeedsSizeChange);
        convWindow.NeedsAttention+=new EventHandler<ConversationWindowNeedsAttentionEventArgs>(Conversation_convWindowNeedsAttention);

    }

    void Conversation_convWindow_NeedsSizeChange(object sender, ConversationWindowNeedsSizeChangeEventArgs e)
    {
        MessageBox.Show("Conversation Window Size changed");
    }

    void Conversation_convWindowNeedsAttention(object sender, ConversationWindowNeedsAttentionEventArgs e)
    {
        MessageBox.Show("Conversation Window Needs Attention");
    }
}

}

È stato utile?

Soluzione

We are only able get Lync IM resizing event, when we have docked that IM window in to some other window using Conversation.Dock( [other window handle] ).

If we haven't dock this IM in to another window we are not going to get the resizing event.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top