ContactStore ContactStore ContactStore ContactStore Class

Represents the custom contact store for a Windows Phone app.

Syntax

Declaration

public sealed class ContactStorepublic sealed class ContactStorePublic NotInheritable Class ContactStorepublic sealed class ContactStore

Properties summary

Gets the revision number for the contact store.

Methods summary

Creates a contact query with the default options.

Creates a contact query with the custom options.

Establishes that the specified contact represents the current signed-in user of the device.

Opens the app's custom contact store, creating the store with the default options if it does not already exist.

Opens the app's custom contact store, creating the store with the specified options if it does not already exist.

Deletes the app's custom contact store.

Deletes the contact with the specified ID from the contact store.

Retrieves the contact with the specified ID from the contact store.

Retrieves the contact with the specified remote ID from the contact store.

Gets the list of changes to the contact store associated with the provided revision number.

Loads the extended properties for the app's custom contact store.

Saves the provided list of name/value pairs to the custom contact store's extended properties.

Properties

  • RevisionNumber
    RevisionNumber
    RevisionNumber
    RevisionNumber

    Gets the revision number for the contact store.

    public ulong RevisionNumber { get; }public ulong RevisionNumber { get; }Public ReadOnly Property RevisionNumber As ulongpublic ulong RevisionNumber { get; }

    Property Value

    • ulong
      ulong
      ulong
      ulong

      The revision number for the contact store.

Methods

  • CreateContactQuery()
    CreateContactQuery()
    CreateContactQuery()
    CreateContactQuery()

    Creates a contact query with the default options.

    public ContactQueryResult CreateContactQuery()public ContactQueryResult CreateContactQuery()Public Function CreateContactQuery() As ContactQueryResultpublic ContactQueryResult CreateContactQuery()

    Returns

  • CreateContactQuery(ContactQueryOptions)
    CreateContactQuery(ContactQueryOptions)
    CreateContactQuery(ContactQueryOptions)
    CreateContactQuery(ContactQueryOptions)

    Creates a contact query with the custom options.

    public ContactQueryResult CreateContactQuery(ContactQueryOptions options)public ContactQueryResult CreateContactQuery(ContactQueryOptions options)Public Function CreateContactQuery(options As ContactQueryOptions) As ContactQueryResultpublic ContactQueryResult CreateContactQuery(ContactQueryOptions options)

    Parameters

    Returns

  • CreateMeContactAsync(String)
    CreateMeContactAsync(String)
    CreateMeContactAsync(String)
    CreateMeContactAsync(String)

    Establishes that the specified contact represents the current signed-in user of the device.

    public IAsyncOperation<StoredContact> CreateMeContactAsync(String id)public IAsyncOperation<StoredContact> CreateMeContactAsync(String id)Public Function CreateMeContactAsync(id As String) As IAsyncOperation( Of StoredContact )public IAsyncOperation<StoredContact> CreateMeContactAsync(String id)

    Parameters

    • id
      System.String
      System.String
      System.String
      System.String

      The ID of the contact that represents the current signed-in user of the device.

    Returns

  • CreateOrOpenAsync()
    CreateOrOpenAsync()
    CreateOrOpenAsync()
    CreateOrOpenAsync()

    Opens the app's custom contact store, creating the store with the default options if it does not already exist.

    public static IAsyncOperation<ContactStore> CreateOrOpenAsync()public static IAsyncOperation<ContactStore> CreateOrOpenAsync()Public Static Function CreateOrOpenAsync() As IAsyncOperation( Of ContactStore )public static IAsyncOperation<ContactStore> CreateOrOpenAsync()

    Returns

    Remarks

    When this method is used to create the custom contact store, the default values of ReadOnly for ContactStoreSystemAccessMode and LimitedReadOnly for ContactStoreApplicationAccessMode are used.

  • CreateOrOpenAsync(ContactStoreSystemAccessMode, ContactStoreApplicationAccessMode)
    CreateOrOpenAsync(ContactStoreSystemAccessMode, ContactStoreApplicationAccessMode)
    CreateOrOpenAsync(ContactStoreSystemAccessMode, ContactStoreApplicationAccessMode)
    CreateOrOpenAsync(ContactStoreSystemAccessMode, ContactStoreApplicationAccessMode)

    Opens the app's custom contact store, creating the store with the specified options if it does not already exist.

    public static IAsyncOperation<ContactStore> CreateOrOpenAsync(ContactStoreSystemAccessMode access, ContactStoreApplicationAccessMode sharing)public static IAsyncOperation<ContactStore> CreateOrOpenAsync(ContactStoreSystemAccessMode access, ContactStoreApplicationAccessMode sharing)Public Static Function CreateOrOpenAsync(access As ContactStoreSystemAccessMode, sharing As ContactStoreApplicationAccessMode) As IAsyncOperation( Of ContactStore )public static IAsyncOperation<ContactStore> CreateOrOpenAsync(ContactStoreSystemAccessMode access, ContactStoreApplicationAccessMode sharing)

    Parameters

    Returns

  • DeleteAsync()
    DeleteAsync()
    DeleteAsync()
    DeleteAsync()

    Deletes the app's custom contact store.

    public IAsyncAction DeleteAsync()public IAsyncAction DeleteAsync()Public Function DeleteAsync() As IAsyncActionpublic IAsyncAction DeleteAsync()

    Returns

  • DeleteContactAsync(String)
    DeleteContactAsync(String)
    DeleteContactAsync(String)
    DeleteContactAsync(String)

    Deletes the contact with the specified ID from the contact store.

    public IAsyncAction DeleteContactAsync(String id)public IAsyncAction DeleteContactAsync(String id)Public Function DeleteContactAsync(id As String) As IAsyncActionpublic IAsyncAction DeleteContactAsync(String id)

    Parameters

    • id
      System.String
      System.String
      System.String
      System.String

      The ID of the contact to be deleted.

    Returns

  • FindContactByIdAsync(String)
    FindContactByIdAsync(String)
    FindContactByIdAsync(String)
    FindContactByIdAsync(String)

    Retrieves the contact with the specified ID from the contact store.

    public IAsyncOperation<StoredContact> FindContactByIdAsync(String id)public IAsyncOperation<StoredContact> FindContactByIdAsync(String id)Public Function FindContactByIdAsync(id As String) As IAsyncOperation( Of StoredContact )public IAsyncOperation<StoredContact> FindContactByIdAsync(String id)

    Parameters

    • id
      System.String
      System.String
      System.String
      System.String

      The ID of the contact to retrieve.

    Returns

  • FindContactByRemoteIdAsync(String)
    FindContactByRemoteIdAsync(String)
    FindContactByRemoteIdAsync(String)
    FindContactByRemoteIdAsync(String)

    Retrieves the contact with the specified remote ID from the contact store.

    public IAsyncOperation<StoredContact> FindContactByRemoteIdAsync(String id)public IAsyncOperation<StoredContact> FindContactByRemoteIdAsync(String id)Public Function FindContactByRemoteIdAsync(id As String) As IAsyncOperation( Of StoredContact )public IAsyncOperation<StoredContact> FindContactByRemoteIdAsync(String id)

    Parameters

    • id
      System.String
      System.String
      System.String
      System.String

      The application-defined remote ID of the contact to retrieve.

    Returns

  • GetChangesAsync(UInt64)
    GetChangesAsync(UInt64)
    GetChangesAsync(UInt64)
    GetChangesAsync(UInt64)

    Gets the list of changes to the contact store associated with the provided revision number.

    public IAsyncOperation<IVectorView<ContactChangeRecord>> GetChangesAsync(UInt64 baseRevisionNumber)public IAsyncOperation<IVectorView<ContactChangeRecord>> GetChangesAsync(UInt64 baseRevisionNumber)Public Function GetChangesAsync(baseRevisionNumber As UInt64) As IAsyncOperation( Of IVectorViewContactChangeRecord )public IAsyncOperation<IVectorView<ContactChangeRecord>> GetChangesAsync(UInt64 baseRevisionNumber)

    Parameters

    • baseRevisionNumber
      System.UInt64
      System.UInt64
      System.UInt64
      System.UInt64

      The revision number for which changes should be retrieved.

    Returns

  • LoadExtendedPropertiesAsync()
    LoadExtendedPropertiesAsync()
    LoadExtendedPropertiesAsync()
    LoadExtendedPropertiesAsync()

    Loads the extended properties for the app's custom contact store.

    public IAsyncOperation<IMap<string, object>> LoadExtendedPropertiesAsync()public IAsyncOperation<IMap<string, object>> LoadExtendedPropertiesAsync()Public Function LoadExtendedPropertiesAsync() As IAsyncOperation( Of IMapstring, object )public IAsyncOperation<IMap<string, object>> LoadExtendedPropertiesAsync()

    Returns

    Remarks

    This method is used to access the extended properties for the contact store, not for individual contacts. A common scenario is to use the contact store's extended properties to store revision numbers for the local contact store and a remote contact store in and then using GetChangesAsync(UInt64) to synchronize the two stores. To access extended properties to individual contacts, see GetExtendedPropertiesAsync().

  • SaveExtendedPropertiesAsync(IMapView<String, Object>)
    SaveExtendedPropertiesAsync(IMapView<String, Object>)
    SaveExtendedPropertiesAsync(IMapView<String, Object>)
    SaveExtendedPropertiesAsync(IMapView<String, Object>)

    Saves the provided list of name/value pairs to the custom contact store's extended properties.

    public IAsyncAction SaveExtendedPropertiesAsync(IMapView<String, Object> data)public IAsyncAction SaveExtendedPropertiesAsync(IMapView<String, Object> data)Public Function SaveExtendedPropertiesAsync(data As IMapView<String, Object>) As IAsyncActionpublic IAsyncAction SaveExtendedPropertiesAsync(IMapView<String, Object> data)

    Parameters

    • data

      The set of name/value properties to set.

    Returns

Device family

Windows Mobile Extension SDK (introduced v10.0.10240.0)

API contract

Windows.Phone.PhoneContract (introduced v1)

Capabilities

ID_CAP_CONTACTS [Windows Phone]

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.StaticAttribute

Details

Assembly

Windows.Phone.PersonalInformation.dll