0

I am trying to create a simple contact manager for Lync 2010 UCMA.

I'm using an NotificationReceived event, and testing if IsFullNotification flag is set. I hoped that as groups are added, there will be no "IsFullNotification".

But such an event never happens, it is always set to true.

How can I still get a full list of contacts with already added groups (as they are added successfully) to remap the contacts before adding the number of newly created.

P.S. Translated using translate.google.com

_contactGroupServices.NotificationReceived += OnNotificationReceived;
_contactGroupServices.BeginSubscribe(ar =>
{
   try
   {
      _contactGroupServices.EndSubscribe(ar);
   }
   catch (RealTimeException rtex)
   {
       Console.WriteLine(rtex);
   }
}
, null);

the handler:

void OnNotificationReceived(object sender, ContactGroupNotificationEventArgs e)
{
    Console.WriteLine("Received a contact update.");

    if (e.IsFullNotification) //always this value :(
    {
        ExtractContactGroupInfo(e);
        AddGroups();
    }
    else
    {
        HandleAddedGroupNotification(e); // The LINE
    }
}                

I've marked the line that I need to execute when all groups were added. And also I will need current value of ContactGroupNotificationEventArgs e.

ekad
  • 14,436
  • 26
  • 44
  • 46
Tahiaji
  • 420
  • 8
  • 15
  • I even try to call BeginSubscribe after fll groups was added, but there an eroor occured: "the data session is in an invalid staate to establish". – Tahiaji Jun 26 '12 at 05:53
  • I've tried to correct the translation a bit, please check whether it 'sounds well' to you. I might have accidentially changed something if I understood you wrong. Also, I could not grasp the meaning of the last "how can I still get(..)" sentence, so I left it as-is. You can try to post the text in two languages, one translated and one original - that way, someone can accuratelly fix the translation errors :) BTW. If "Roman" is the Polish first name, I can help next time:) – quetzalcoatl Aug 23 '12 at 14:46

1 Answers1

3

I too had this same issue, this is because your call to BeginSubscribe is made but the subscription is not complete. Make sure that before you add a group the _contactGroupService.State is subcribed. If not wait till it becomes subscribed. This should hopefully resolve your issue.

Happy coding :)

Ankita
  • 31
  • 2