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 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 ulong

    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 ContactQueryResult

    Returns

  • CreateContactQuery(Windows.Phone.PersonalInformation.ContactQueryOptions)
    CreateContactQuery(Windows.Phone.PersonalInformation.ContactQueryOptions)
    CreateContactQuery(Windows.Phone.PersonalInformation.ContactQueryOptions)
    CreateContactQuery(Windows.Phone.PersonalInformation.ContactQueryOptions)

    Creates a contact query with the custom options.

    public ContactQueryResult CreateContactQuery(Windows.Phone.PersonalInformation.ContactQueryOptions)public ContactQueryResult CreateContactQuery(Windows.Phone.PersonalInformation.ContactQueryOptions)Public Function CreateContactQuery(Windows.Phone.PersonalInformation.ContactQueryOptions) As ContactQueryResult

    Parameters

    Returns

  • CreateMeContactAsync(System.String)
    CreateMeContactAsync(System.String)
    CreateMeContactAsync(System.String)
    CreateMeContactAsync(System.String)

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

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

    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 )

    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(Windows.Phone.PersonalInformation.ContactStoreSystemAccessMode,Windows.Phone.PersonalInformation.ContactStoreApplicationAccessMode)
    CreateOrOpenAsync(Windows.Phone.PersonalInformation.ContactStoreSystemAccessMode,Windows.Phone.PersonalInformation.ContactStoreApplicationAccessMode)
    CreateOrOpenAsync(Windows.Phone.PersonalInformation.ContactStoreSystemAccessMode,Windows.Phone.PersonalInformation.ContactStoreApplicationAccessMode)
    CreateOrOpenAsync(Windows.Phone.PersonalInformation.ContactStoreSystemAccessMode,Windows.Phone.PersonalInformation.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(Windows.Phone.PersonalInformation.ContactStoreSystemAccessMode,Windows.Phone.PersonalInformation.ContactStoreApplicationAccessMode)public static IAsyncOperation<ContactStore> CreateOrOpenAsync(Windows.Phone.PersonalInformation.ContactStoreSystemAccessMode,Windows.Phone.PersonalInformation.ContactStoreApplicationAccessMode)Public Static Function CreateOrOpenAsync(Windows.Phone.PersonalInformation.ContactStoreSystemAccessMode,Windows.Phone.PersonalInformation.ContactStoreApplicationAccessMode) As IAsyncOperation( Of ContactStore )

    Parameters

    Returns

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

    Deletes the app's custom contact store.

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

    Returns

  • DeleteContactAsync(System.String)
    DeleteContactAsync(System.String)
    DeleteContactAsync(System.String)
    DeleteContactAsync(System.String)

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

    public IAsyncAction DeleteContactAsync(System.String)public IAsyncAction DeleteContactAsync(System.String)Public Function DeleteContactAsync(System.String) As IAsyncAction

    Parameters

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

      The ID of the contact to be deleted.

    Returns

  • FindContactByIdAsync(System.String)
    FindContactByIdAsync(System.String)
    FindContactByIdAsync(System.String)
    FindContactByIdAsync(System.String)

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

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

    Parameters

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

      The ID of the contact to retrieve.

    Returns

  • FindContactByRemoteIdAsync(System.String)
    FindContactByRemoteIdAsync(System.String)
    FindContactByRemoteIdAsync(System.String)
    FindContactByRemoteIdAsync(System.String)

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

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

    Parameters

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

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

    Returns

  • GetChangesAsync(System.UInt64)
    GetChangesAsync(System.UInt64)
    GetChangesAsync(System.UInt64)
    GetChangesAsync(System.UInt64)

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

    public IAsyncOperation<ContactChangeRecord>> GetChangesAsync(System.UInt64)public IAsyncOperation<ContactChangeRecord>> GetChangesAsync(System.UInt64)Public Function GetChangesAsync(System.UInt64) As IAsyncOperation( Of ContactChangeRecord )

    Parameters

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

    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 )

    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(System.UInt64) to synchronize the two stores. To access extended properties to individual contacts, see GetExtendedPropertiesAsync().

  • SaveExtendedPropertiesAsync(Windows.Foundation.Collections.IMapView{System.String, System.Object})
    SaveExtendedPropertiesAsync(Windows.Foundation.Collections.IMapView{System.String, System.Object})
    SaveExtendedPropertiesAsync(Windows.Foundation.Collections.IMapView{System.String, System.Object})
    SaveExtendedPropertiesAsync(Windows.Foundation.Collections.IMapView{System.String, System.Object})

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

    public IAsyncAction SaveExtendedPropertiesAsync(Windows.Foundation.Collections.IMapView{System.String, System.Object})public IAsyncAction SaveExtendedPropertiesAsync(Windows.Foundation.Collections.IMapView{System.String, System.Object})Public Function SaveExtendedPropertiesAsync(Windows.Foundation.Collections.IMapView{System.String, System.Object}) As IAsyncAction

    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.StaticAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.Phone.PersonalInformation.dll