private void SearchContact() { if (!rainbowApplication.IsConnected()) { return; } string search = txt_search.StringValue; if (!String.IsNullOrEmpty(search)) { rainbowContacts.SearchContactsByDisplayName(search, 20, callback => { if (callback.Result.Success) { SearchContactsResult result = callback.Data; rainbowContactsListFound = result.ContactsList; AddStateLine($"Nb Rainbow contacts found with [{search}]: {rainbowContactsListFound.Count}"); BeginInvokeOnMainThread(() => UpdateContactsListFoundCombobox()); } else { string logline = String.Format("Impossible to search this [{1}]:\r\n{0}", Util.SerializeSdkError(callback.Result), search); AddStateLine(logline); log.Warn(logline); } }); } }
private void btnSearch_Click(object sender, EventArgs e) { if (!rainbowApplication.IsConnected()) { return; } string search = tbSearch.Text; if (!String.IsNullOrEmpty(search)) { rainbowContacts.SearchContactsByDisplayName(search, 20, callback => { if (callback.Result.Success) { SearchContactsResult result = callback.Data; rainbowContactsListFound = result.ContactsList; AddStateLine($"Nb rainbow contacts found with [{search}]: {rainbowContactsListFound.Count}"); UpdateContactsListFoundComboBox(); } else { string logLine = String.Format("Impossible to get avatar of this contact:\r\n{0}", Util.SerializeSdkError(callback.Result)); AddStateLine(logLine); log.LogInformation(logLine); } }); } }