Skip to content

Instantly share code, notes, and snippets.

@mcarbenay
Created December 3, 2017 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcarbenay/edbcabcfcabe2ee639c00861d1b9cf58 to your computer and use it in GitHub Desktop.
Save mcarbenay/edbcabcfcabe2ee639c00861d1b9cf58 to your computer and use it in GitHub Desktop.
public static MettreAJour() {
// on obtient une ref. sur le store en mode "écriture"
Windows.ApplicationModel.Contacts.ContactManager.requestStoreAsync(
Windows.ApplicationModel.Contacts.ContactStoreAccessType.appContactsReadWrite
).done(function (store) {
// on énumère les listes pour vérifier si la notre existe
// déjà : si oui, on l'update sinon on la créé
store.findContactListsAsync().done(function (lists) {
var laListe = null;
for (var i = 0; i < lists.length; i++) {
if (lists[i].displayName == ListeContactSample.listName) {
laListe = lists[i];
}
}
if (laListe == null) {
ListeContactSample.createContactList(store);
}
else {
ListeContactSample.refreshContactList(laListe);
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment