ContactInstantMessageField ContactInstantMessageField ContactInstantMessageField ContactInstantMessageField Class

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

Syntax

Declaration

public sealed class ContactInstantMessageFieldpublic sealed class ContactInstantMessageFieldPublic NotInheritable Class ContactInstantMessageField

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

Constructors summary

Note

IContactInstantMessageFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount.

Creates a new ContactInstantMessageField object.

Note

IContactInstantMessageFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount.

Creates a new ContactInstantMessageField object.

Note

IContactInstantMessageFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount.

Creates a new ContactInstantMessageField object.

Properties summary

Note

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.

Note

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

Note

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

Note

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.

Note

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

Note

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.

Note

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

Gets the user's name.

Note

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.

Constructors

  • ContactInstantMessageField(System.String)
    ContactInstantMessageField(System.String)
    ContactInstantMessageField(System.String)
    ContactInstantMessageField(System.String)
    Note

    IContactInstantMessageFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount.

    Creates a new ContactInstantMessageField object.

    public ContactInstantMessageField(System.String)public ContactInstantMessageField(System.String)Public Function ContactInstantMessageField(System.String) As

    Parameters

    • userName
      System.String
      System.String
      System.String
      System.String

      The user's name.

  • ContactInstantMessageField(System.String,Windows.ApplicationModel.Contacts.ContactFieldCategory)
    ContactInstantMessageField(System.String,Windows.ApplicationModel.Contacts.ContactFieldCategory)
    ContactInstantMessageField(System.String,Windows.ApplicationModel.Contacts.ContactFieldCategory)
    ContactInstantMessageField(System.String,Windows.ApplicationModel.Contacts.ContactFieldCategory)
    Note

    IContactInstantMessageFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount.

    Creates a new ContactInstantMessageField object.

    public ContactInstantMessageField(System.String,Windows.ApplicationModel.Contacts.ContactFieldCategory)public ContactInstantMessageField(System.String,Windows.ApplicationModel.Contacts.ContactFieldCategory)Public Function ContactInstantMessageField(System.String,Windows.ApplicationModel.Contacts.ContactFieldCategory) As

    Parameters

  • ContactInstantMessageField(System.String,Windows.ApplicationModel.Contacts.ContactFieldCategory,System.String,System.String,Windows.Foundation.Uri)
    ContactInstantMessageField(System.String,Windows.ApplicationModel.Contacts.ContactFieldCategory,System.String,System.String,Windows.Foundation.Uri)
    ContactInstantMessageField(System.String,Windows.ApplicationModel.Contacts.ContactFieldCategory,System.String,System.String,Windows.Foundation.Uri)
    ContactInstantMessageField(System.String,Windows.ApplicationModel.Contacts.ContactFieldCategory,System.String,System.String,Windows.Foundation.Uri)
    Note

    IContactInstantMessageFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount.

    Creates a new ContactInstantMessageField object.

    public ContactInstantMessageField(System.String,Windows.ApplicationModel.Contacts.ContactFieldCategory,System.String,System.String,Windows.Foundation.Uri)public ContactInstantMessageField(System.String,Windows.ApplicationModel.Contacts.ContactFieldCategory,System.String,System.String,Windows.Foundation.Uri)Public Function ContactInstantMessageField(System.String,Windows.ApplicationModel.Contacts.ContactFieldCategory,System.String,System.String,Windows.Foundation.Uri) As

    Parameters

    • userName
      System.String
      System.String
      System.String
      System.String

      The user's name.

    • category

      The category of the contact data.

    • service
      System.String
      System.String
      System.String
      System.String

      The name of the instant messaging service.

    • displayText
      System.String
      System.String
      System.String
      System.String

      The display text used with the instant messaging Uniform Resource Identifier (URI).

    • verb

      The Uniform Resource Identifier (URI) that starts an instant message.

Properties

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.ApplicationModel.Contacts.dll