ContactInstantMessageField class

Applies to Windows and Windows Phone

[ContactInstantMessageField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount. ]

Defines a field that is an instant messaging (IM) address.

Syntax


public sealed class ContactInstantMessageField : IContactField

Attributes

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

Members

The ContactInstantMessageField class has these types of members:

Constructors

The ContactInstantMessageField class has these constructors.

ConstructorDescription
ContactInstantMessageField(String) IContactInstantMessageFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount. Creates a new ContactInstantMessageField object.
ContactInstantMessageField(String,ContactFieldCategory) IContactInstantMessageFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount. Creates a new ContactInstantMessageField object.
ContactInstantMessageField(String,ContactFieldCategory,String,String,Uri) IContactInstantMessageFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount. Creates a new ContactInstantMessageField object.

 

Properties

The ContactInstantMessageField class has these properties.

PropertyAccess typeDescription

Category

Read-onlyIContactField 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.

DisplayText

Read-onlyContactInstantMessageField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount. Gets the display text for the Uniform Resource Identifier (URI) that starts an instant message.

LaunchUri

Read-onlyContactInstantMessageField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount. Gets the Uniform Resource Identifier (URI) that can start an instant message.

Name

Read-onlyIContactField 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.

Service

Read-onlyContactInstantMessageField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount. Gets the name of the service used for sending instant messages.

Type

Read-onlyIContactField 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.

UserName

Read-onlyContactInstantMessageField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount. Gets the user's name.

Value

Read-onlyIContactField 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 ContactInstantMessageField objects when a contact provider returns the requested contact information. You can access these objects through the ContactInformation.InstantMessages property.

Examples

This code demonstrates the use of the ContactInstantMessageField object.


function getInstantMessageInfo() {
    var picker = Windows.ApplicationModel.Contacts.ContactPicker();
    picker.commitButtonText = "Select";
    picker.selectionMode = Windows.ApplicationModel.Contacts.ContactSelectionMode.fields;
    picker.desiredFields.append(Windows.ApplicationModel.Contacts.KnownContactField.instantMessage);
    picker.pickSingleContactAsync().then(function (contact) {
        var contactElement = document.createElement("div");
        var contactData = contact.name + "<br/>";
        contactData += contact.instantMessages[0].displayText + "<br/>";
        contactData += contact.instantMessages[0].launchUri + "<br/>";
        contactData += contact.instantMessages[0].service + "<br/>";
        contactData += contact.instantMessages[0].userName + "<br/>";
        contactData += contact.instantMessages[0].category + "<br/>";
        contactData += contact.instantMessages[0].type;
        contactElement.innerHTML = contactData;
        document.body.appendChild(contactElement);
    });
}


Requirements

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

 

 

Show:
© 2014 Microsoft. All rights reserved.