void _IUccUserSearchQueryEvents.OnExecute(UccUserSearchQuery eventSource, UccUserSearchQueryEvent eventData) { if (eventData.IsComplete) { var result = new UserSearchEventArgs(eventData); foreach (var item in result.Results) { item.InContacts = Presentities.Contain(item.Uri); } OnEvent <UserSearchEventArgs>(UserSearchFinished, result); } }
public UserSearchEventArgs(UccUserSearchQueryEvent eventData) : base(eventData) { OperationId = eventData.OriginalOperationContext.OperationId; MoreAvailable = eventData.MoreAvailable; Results = new SearchUserRecord[eventData.Results.Count]; for (int i = 0; i < eventData.Results.Count; i++) { var record = eventData.Results[i + 1] as IUccUserSearchResultRecord; Results[i] = new SearchUserRecord(); try { Results[i].Uri = record.get_Value(UCC_USER_SEARCH_COLUMN.UCCUSC_URI); } catch (COMException) { } try { Results[i].DisplayName = record.get_Value(UCC_USER_SEARCH_COLUMN.UCCUSC_DISPLAYNAME); } catch (COMException) { } try { Results[i].Title = record.get_Value(UCC_USER_SEARCH_COLUMN.UCCUSC_TITLE); } catch (COMException) { } try { Results[i].Office = record.get_Value(UCC_USER_SEARCH_COLUMN.UCCUSC_OFFICE); } catch (COMException) { } try { Results[i].Phone = record.get_Value(UCC_USER_SEARCH_COLUMN.UCCUSC_PHONE); } catch (COMException) { } try { Results[i].Company = record.get_Value(UCC_USER_SEARCH_COLUMN.UCCUSC_COMPANY); } catch (COMException) { } try { Results[i].City = record.get_Value(UCC_USER_SEARCH_COLUMN.UCCUSC_CITY); } catch (COMException) { } try { Results[i].State = record.get_Value(UCC_USER_SEARCH_COLUMN.UCCUSC_STATE); } catch (COMException) { } try { Results[i].Country = record.get_Value(UCC_USER_SEARCH_COLUMN.UCCUSC_COUNTRY); } catch (COMException) { } try { Results[i].Email = record.get_Value(UCC_USER_SEARCH_COLUMN.UCCUSC_EMAIL); } catch (COMException) { } } }