Windows Dev Center

ContactLocationField Class

[ContactLocationField peut être modifié ou non disponible pour les versions ultérieures à Windows 8.1. Utilisez plutôt ContactAddress. ]

Contient des informations sur l'emplacement et l'adresse d'un utilisateur.

Syntaxe


var contactLocationField = new Windows.ApplicationModel.Contacts.ContactLocationField(string);
var contactLocationField = new Windows.ApplicationModel.Contacts.ContactLocationField(string, contactFieldCategory);
var contactLocationField = new Windows.ApplicationModel.Contacts.ContactLocationField(string, contactFieldCategory, string, string, string, string, string);

Attributs

[Deprecated()]
[MarshalingBehavior(Agile)]
[Version(0x06020000)]

Membres

ContactLocationFieldClasse possède ces types de membres :

Constructeurs

ContactLocationFieldClasse possède ces constructeurs.

ConstructeurDescription
ContactLocationField(String) IContactLocationFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Creates a new ContactLocationField object.
ContactLocationField(String, ContactFieldCategory) IContactLocationFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Creates a new ContactLocationField object.
ContactLocationField(String, ContactFieldCategory, String, String, String, String, String) IContactLocationFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Creates a new ContactLocationField object.

 

Méthodes

The ContactLocationField Classe hérite des méthodes de Object Classe (C#/VB/C++).

Propriétés

Le ContactLocationFieldClasse a les propriétés suivantes.

PropriétéType d'accèsDescription

Category

En lecture seuleIContactField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress, ContactPhone, ContactSignificantOther, Contact, ContactEmail, ContactConnectedServiceAccount, ContactWebsite, ContactJobInfo, or ContactDate. Gets the category for the contact data.

City

En lecture seuleContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Gets the contact's city.

Country

En lecture seuleContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Gets the contact's country.

Name

En lecture seuleIContactField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress, ContactPhone, ContactSignificantOther, Contact, ContactEmail, ContactConnectedServiceAccount, ContactWebsite, ContactJobInfo, or ContactDate. Gets the name of the field.

PostalCode

En lecture seuleContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Gets the contact's postal code.

Region

En lecture seuleContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Gets the contact's region.

Street

En lecture seuleContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Gets the contact's street.

Type

En lecture seuleIContactField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress, ContactPhone, ContactSignificantOther, Contact, ContactEmail, ContactConnectedServiceAccount, ContactWebsite, ContactJobInfo, or ContactDate. Gets the contact field type for the data.

UnstructuredAddress

En lecture seuleContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Gets a string that represents an unstructured address.

Value

En lecture seuleIContactField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress, ContactPhone, ContactSignificantOther, Contact, ContactEmail, ContactConnectedServiceAccount, ContactWebsite, ContactJobInfo, or ContactDate. Gets the value of the contact data.

 

Remarques

Votre application reçoit une collection d'objets ContactLocationField lorsqu'un fournisseur de contact retourne les informations de contact demandées. Vous pouvez accéder à ces objets via la propriété ContactInformation.Location.

Exemples

Cet exemple de code montre l'utilisation de l'objet ContactInstantMessageField.


function getLocation() {
    var picker = Windows.ApplicationModel.Contacts.ContactPicker();
    picker.commitButtonText = "Select";
    picker.selectionMode = Windows.ApplicationModel.Contacts.ContactSelectionMode.fields;
    picker.desiredFields.append(Windows.ApplicationModel.Contacts.KnownContactField.location);
    picker.pickSingleContactAsync().then(function (contact) {
        var contactElement = document.createElement("div");
        var contactData = contact.name + "<br/>";
        contactData += contact.locations[0].city + "<br/>";
        contactData += contact.locations[0].country + "<br/>";
        contactData += contact.locations[0].postalcode + "<br/>";
        contactData += contact.locations[0].region = "<br/>";
        contactData += contact.locations[0].street + "<br/>";
        contactData += contact.instantMessages[0].category + "<br/>";
        contactData += contact.instantMessages[0].type;
        contactElement.innerHTML = contactData;
        document.body.appendChild(contactElement);
    });
}


Conditions requises

Client minimal pris en charge

Windows 8 [Applications Windows Store uniquement]

Serveur minimal pris en charge

Windows Server 2012 [Applications Windows Store uniquement]

Espace de noms

Windows.ApplicationModel.Contacts
Windows::ApplicationModel::Contacts [C++]

Métadonnées

Windows.winmd

 

 

Afficher:
© 2015 Microsoft