本文整理汇总了C#中Contacts.SearchAsync方法的典型用法代码示例。如果您正苦于以下问题:C# Contacts.SearchAsync方法的具体用法?C# Contacts.SearchAsync怎么用?C# Contacts.SearchAsync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contacts
的用法示例。
在下文中一共展示了Contacts.SearchAsync方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Details_Loaded
private void Details_Loaded(object sender, RoutedEventArgs e)
{
var name = NavigationContext.QueryString["name"];
Contacts c = new Contacts();
c.SearchCompleted += c_SearchCompleted;
c.SearchAsync(name, FilterKind.DisplayName, name);
}
示例2: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
Contacts objContacts = new Contacts();
objContacts.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(objContacts_SearchCompleted);
objContacts.SearchAsync(string.Empty, FilterKind.None, null);
}
示例3: GetAllAsync
public Task<Contact[]> GetAllAsync()
{
var taskCompletionSource = new TaskCompletionSource<Contact[]>();
var contacts = new Contacts();
contacts.SearchCompleted += (sender, args) =>
{
var addressbook = args.Results
.Where(i => !string.IsNullOrEmpty(i.DisplayName))
.Select(ToContact)
.ToArray();
//if there is no any contact (run in emulator?) - add several fakes
if (!addressbook.Any())
{
addressbook = new[]
{
new Contact { Name = "Egor Bogatov", Number = "+01231"},
new Contact { Name = "Ian Gillan", Number = "+01232"},
new Contact { Name = "Freddie Mercury", Number = "+01233"},
new Contact { Name = "David Gilmour", Number = "+01234"},
new Contact { Name = "Steve Ballmer", Number = "+01235"},
};
}
taskCompletionSource.SetResult(addressbook);
};
contacts.SearchAsync(string.Empty, FilterKind.DisplayName, null);
return taskCompletionSource.Task;
}
示例4: LoadContactsToDbAsync
public void LoadContactsToDbAsync()
{
var cons = new Contacts();
cons.SearchCompleted += ContactsSearchCompleted;
cons.SearchAsync(String.Empty, FilterKind.None, null);
}
示例5: fillContactsTextBox
private string fillContactsTextBox()
{
Contacts cons = new Contacts();
str = "";
cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(Contacts_SearchCompleted);
cons.SearchAsync(String.Empty, FilterKind.None, "Contacts Test #1");
return str;
}
示例6: SearchContacts
private void SearchContacts()
{
Contacts cons = new Contacts();
cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(Contacts_SearchCompleted);
cons.SearchAsync(String.Empty, contactFilterKind, "Contacts Test #1");
}
示例7: SyncContacts
public async Task SyncContacts() {
await TelegramSession.Instance.Established;
Contacts contacts = new Contacts();
contacts.SearchCompleted += ContactsOnSearchCompleted;
contacts.SearchAsync(String.Empty, FilterKind.None, "Addressbook Contacts Sync");
}
示例8: ProcurarContacto_Click
private void ProcurarContacto_Click(object sender, RoutedEventArgs e)
{
var contacts = new Contacts();
contacts.SearchCompleted += Contacts_SearchCompleted;
contacts.SearchAsync(nomeTextbox.Text,
FilterKind.DisplayName, null);
}
示例9: addressTask_Completed
void addressTask_Completed(object sender, AddressResult e)
{
if (e.TaskResult == TaskResult.OK)
{
Contacts contacts = new Contacts();
contacts.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(contacts_SearchCompleted);
contacts.SearchAsync(e.DisplayName, FilterKind.DisplayName, null);
}
}
示例10: People
public People()
{
//setProgressBar(true);
InitializeComponent();
Contacts objContacts = new Contacts();
objContacts.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(Contacts_SearchCompleted);
objContacts.SearchAsync(string.Empty, FilterKind.None, null);
progressBar.Visibility = Visibility.Visible;
}
示例11: LoadData
public void LoadData(bool refresh)
{
ContactItems.Clear();
settings.IsLoadingContentSetting = true;
Contacts cons = new Contacts();
LoadFavorites("Favorites");
cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(ContactsSearch_Completed);
cons.SearchAsync(String.Empty, FilterKind.None," Test" );
}
示例12: GetContactPictures_Click
private void GetContactPictures_Click(object sender, RoutedEventArgs e)
{
Contacts cons = new Contacts();
//Identify the method that runs after the asynchronous search completes.
cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(Contacts_SearchCompleted_Many);
//Start the asynchronous search.
cons.SearchAsync(String.Empty, FilterKind.None, "Contacts Test #3 Picture");
}
示例13: CreateContactStore
private async void CreateContactStore()
{
contacts = await ContactStore.CreateOrOpenAsync(ContactStoreSystemAccessMode.ReadWrite, ContactStoreApplicationAccessMode.ReadOnly);
if (contacts.RevisionNumber <1)
{
Contacts cons = new Contacts();
cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(SearchCompleted);
cons.SearchAsync(String.Empty, FilterKind.None, "Searching");
}
}
示例14: PhoneNumbersGetContacts
private void PhoneNumbersGetContacts()
{
Contacts cons = new Contacts();
//Identify the method that runs after the asynchronous search completes.
cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(cons_SearchCompleted);
//Start the asynchronous search.
cons.SearchAsync(String.Empty, FilterKind.DisplayName, null);
}
示例15: UserListControl
public UserListControl() {
InitializeComponent();
Contacts contacts = new Contacts();
contacts.SearchCompleted += ContactsOnSearchCompleted;
contacts.SearchAsync(String.Empty, FilterKind.None, "Addressbook Contacts");
FriendsList.ItemsSource = friendList;
GetFriends();
// initDemo();
}