Aplicativos do Windows
Recolher sumário
Expandir sumário
EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

ContactLocationField class

Contains information about a user's location and address.

Syntax


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);

Members

The ContactLocationField class has these types of members:

Constructors

The ContactLocationField class has these constructors.

ConstructorDescription
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.

 

Properties

The ContactLocationField class has these properties.

PropertyAccess typeDescription

Category

Read-only

IContactField 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

Read-only

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

Country

Read-only

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

Name

Read-only

IContactField 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

Read-only

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

Region

Read-only

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

Street

Read-only

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

Type

Read-only

IContactField 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

Read-only

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

Value

Read-only

IContactField 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.

 

Remarks

Your app receives a collection of ContactLocationField objects when a contact provider returns the requested contact information. You can access these objects through the ContactInformation.Location property.

Examples

This code example demonstrates the use of the ContactInstantMessageField object.


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);
    });
}


Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

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

Metadata

Windows.winmd

Attributes

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

See also

Object
IContactField

 

 

Mostrar:
© 2016 Microsoft