7/2/2023 0 Comments Microsoft lync![]() ![]() If (().Name = "Contact")Ĭontact contact = selectedContact.Result as Contact selectedContact = ()ResultList.SelectedItem Private void AddContactToGroup_Click(object sender, RoutedEventArgs e) / Adds the contact that is selected in the contact search results list to the group that is selected. The following example gets a selected contact from the control on a WPF form and then adds the contact to a previously selected .Group. Select a Contact object from the collection of search results returned by a contact search.Īdd the selected contact to the selected group by calling the Group.BeginAddContact method. Select a .Group object from the user’s custom group collection by getting a Group from the ContactManager.Groups property. To learn how to search for a contact, see How to: Search for a contact or distribution group in Lync SDK. A contact that is obtained by using the search feature of the Lync 2013 API is guaranteed to publish presence availability. ![]() Although you can add a object to the contact list regardless of the origin of the contact, it is best to add contacts that publish presence availability. ![]() To add a contact to the user’s contact list, get a contact object and add it to any of the custom groups in the contact list. GroupWrapper groupToList = (GroupWrapper)GroupList_ListBox.SelectedItem įoreach (Contact contact in groupToList.LyncGroup)ĬontactWrapper contactWrapper = new ContactWrapper(contact) ĬontactList_(contactWrapper) Private void GroupList_ListBox_SelectionChanged(object sender, e) / Loads all of the contacts for a selected group into a contact Doing this allows you to avoid running a routine that looks up a Contact object based on a display name every time a user selects a contact in the list. When a user selects a contact from the list, the actual contact object is selected. Add the encapsulating class object to the list instead of a simple string. DisplayName string as return value in the overridden ToString method. Return the contact ContactInformationType. When you have gotten a Contact object to display, you should encapsulate the contact in a custom class that overrides the ToString method. The Group object is a collection of objects.įor each Contact in the collection, add the display name of the contact to the contact list on the UI. Iterate on the .Group object that the user selected in the group list. GroupWrapper gWrap = new GroupWrapper(group) The Group is wrapped in a custom class to allow / by iterating on the Groups collection of the ContactManagerįoreach (Group group in _) / Loads a list box with existing contact list groups Doing this allows you to avoid running a routine that gets a group associated with a name string every time a selection is made in the list. When a user selects a group from the list, the actual group is selected. Return the Group.Name string as return value in the overridden ToString method. When you get a Group object to display, encapsulate the Group in a custom class that overrides the ToString method. Iterate on the group collection returned in the ContactManager.Groups property value in a foreach loop.įor each group instance, read the string Group.Name property value and add it to the group list in the UI. To fill the group and contact lists in the sample, use the following procedure. The sample application at the end of this topic displays a list of contacts for the group selected by the user from a list of groups. Read about How to: Sign a user in to Lync and be sure that your application logic provides this capability before adding a contact list to your UI. You can also get the Contact instance by iterating on the group collection value returned by getting the ContactManager.Groups property and then iterating on each group to access the individual contacts.Ĭontacts and groups are available when the user is signed in to Lync 2013. If you have the SIP URI of the Lync user to be removed from the contact list, simply call the ContactManager.GetContactByUri method. There are several ways to obtain a object. To delete a contact from a user’s contact list, a object most be obtained. Microsoft Lync 2013 SDK must be installed on the development computer. You must have sign-in credentials for Microsoft Lync Server 2013. Microsoft Lync 2013 must be installed and running on the development computer. The prerequisites for adding or removing a custom group are as follows: Learn how to remove a contact from a Microsoft Lync 2013 user’s contact list by calling methods from the Microsoft Lync 2013 API. ![]()
0 Comments
Leave a Reply. |