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 options)public ContactQueryResult CreateContactQuery(Windows.Phone.PersonalInformation.ContactQueryOptions options)Public Function CreateContactQuery(options As 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 id)public IAsyncOperation<StoredContact> CreateMeContactAsync(System.String id)Public Function CreateMeContactAsync(id As 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 access,Windows.Phone.PersonalInformation.ContactStoreApplicationAccessMode sharing)public static IAsyncOperation<ContactStore> CreateOrOpenAsync(Windows.Phone.PersonalInformation.ContactStoreSystemAccessMode access,Windows.Phone.PersonalInformation.ContactStoreApplicationAccessMode sharing)Public Static Function CreateOrOpenAsync(access As Windows.Phone.PersonalInformation.ContactStoreSystemAccessMode,sharing As 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 id)public IAsyncAction DeleteContactAsync(System.String id)Public Function DeleteContactAsync(id As 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 id)public IAsyncOperation<StoredContact> FindContactByIdAsync(System.String id)Public Function FindContactByIdAsync(id As 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 id)public IAsyncOperation<StoredContact> FindContactByRemoteIdAsync(System.String id)Public Function FindContactByRemoteIdAsync(id As 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 baseRevisionNumber)public IAsyncOperation<ContactChangeRecord>> GetChangesAsync(System.UInt64 baseRevisionNumber)Public Function GetChangesAsync(baseRevisionNumber As 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} data)public IAsyncAction SaveExtendedPropertiesAsync(Windows.Foundation.Collections.IMapView{System.String, System.Object} data)Public Function SaveExtendedPropertiesAsync(data As 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