ContactAnnotationList ContactAnnotationList ContactAnnotationList ContactAnnotationList Class

Definition

Represents a list of ContactAnnotation objects.

public : sealed class ContactAnnotationList : IContactAnnotationListpublic sealed class ContactAnnotationList : IContactAnnotationListPublic NotInheritable Class ContactAnnotationList Implements IContactAnnotationList// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Call one of the following methods to create or get an existing ContactAnnotationList:

Properties

Id Id Id Id

Gets the ID for this ContactAnnotationList.

public : PlatForm::String Id { get; }public string Id { get; }Public ReadOnly Property Id As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The ID for this ContactAnnotationList.

ProviderPackageFamilyName ProviderPackageFamilyName ProviderPackageFamilyName ProviderPackageFamilyName

Gets the unique identifier for the app package that created the ContactAnnotationList.

public : PlatForm::String ProviderPackageFamilyName { get; }public string ProviderPackageFamilyName { get; }Public ReadOnly Property ProviderPackageFamilyName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The unique identifier for the app package that created the ContactAnnotationList.

UserDataAccountId UserDataAccountId UserDataAccountId UserDataAccountId

Gets the ID for the UserDataAccount used by the app.

public : PlatForm::String UserDataAccountId { get; }public string UserDataAccountId { get; }Public ReadOnly Property UserDataAccountId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The ID for the UserDataAccount used by the app.

Methods

DeleteAnnotationAsync(ContactAnnotation) DeleteAnnotationAsync(ContactAnnotation) DeleteAnnotationAsync(ContactAnnotation) DeleteAnnotationAsync(ContactAnnotation)

Asynchronously deletes the specified ContactAnnotation from the list.

public : IAsyncAction DeleteAnnotationAsync(ContactAnnotation annotation)public IAsyncAction DeleteAnnotationAsync(ContactAnnotation annotation)Public Function DeleteAnnotationAsync(annotation As ContactAnnotation) As IAsyncAction// You can use this method in JavaScript.
Parameters
annotation
ContactAnnotation ContactAnnotation ContactAnnotation ContactAnnotation

The annotation to delete from the list.

Returns

An async action indicating that the operation has completed.

DeleteAsync() DeleteAsync() DeleteAsync() DeleteAsync()

Asynchronously deletes this ContactAnnotationList from the ContactAnnotationStore.

public : IAsyncAction DeleteAsync()public IAsyncAction DeleteAsync()Public Function DeleteAsync() As IAsyncAction// You can use this method in JavaScript.
Returns

An async action indicating that the operation has completed.

Examples

The following example provides reusable methods for creating an annotation list, deleting a specific annotation list, and deleting all annotation lists in a store.

public async Task<ContactAnnotationList> CreateAnnotationList()
{
    // Get the data store.
    ContactAnnotationStore store = await ContactManager.RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType.AppAnnotationsReadWrite);

    // Create a new list.
    ContactAnnotationList list = await store.CreateAnnotationListAsync();

    // Find the list to verify it was created.
    IReadOnlyList<ContactAnnotationList> lists = await store.FindAnnotationListsAsync();

    for (int i = 0; i < lists.Count; i++)
    {
        // Do the IDs match?
        if (list.Id == lists[i].Id)
        {
            // Found it! Return the new list.
            return(list);
        }
    }

    // List not created, return null.
    return(null);
}

public async Task<Boolean> DeleteAnnotationList(string listId)
{
    // Get the store.
    ContactAnnotationStore store = await ContactManager.RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType.AppAnnotationsReadWrite);

    // Find the list.
    ContactAnnotationList list = await store.GetAnnotationListAsync(listId);

    // Make sure we got it.
    if (list.Id == listId)
    {
        // Delete the list.
        await list.DeleteAsync();
        return true;
    }

    return false;
}

public async Task<Boolean> DeleteAllAnnotationLists()
{
    // Get the store.
    ContactAnnotationStore store = await ContactManager.RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType.AppAnnotationsReadWrite);

    IReadOnlyList<ContactAnnotationList> lists = await store.FindAnnotationListsAsync();

    // Make sure at least one annotation list exists.
    if (lists.Count > 0)
    {
        // Find the list.
        for (int i = 0; i < lists.Count; i++)
        {
            await lists[i].DeleteAsync();
        }

        return true;
    }

    return false;
}

FindAnnotationsAsync() FindAnnotationsAsync() FindAnnotationsAsync() FindAnnotationsAsync()

Asynchronously gets the list of ContactAnnotation objects.

public : IAsyncOperation<IVectorView<ContactAnnotation>> FindAnnotationsAsync()public IAsyncOperation<IReadOnlyList<ContactAnnotation>> FindAnnotationsAsync()Public Function FindAnnotationsAsync() As IAsyncOperation( Of IReadOnlyListContactAnnotation )// You can use this method in JavaScript.
Returns
IAsyncOperation<IVectorView<ContactAnnotation>> IAsyncOperation<IReadOnlyList<ContactAnnotation>> IAsyncOperation<IReadOnlyList<ContactAnnotation>> IAsyncOperation<IReadOnlyList<ContactAnnotation>>

The list of ContactAnnotation objects.

FindAnnotationsByRemoteIdAsync(String) FindAnnotationsByRemoteIdAsync(String) FindAnnotationsByRemoteIdAsync(String) FindAnnotationsByRemoteIdAsync(String)

Gets the list of ContactAnnotation objects containing the specified remote ID property.

public : IAsyncOperation<IVectorView<ContactAnnotation>> FindAnnotationsByRemoteIdAsync(PlatForm::String remoteId)public IAsyncOperation<IReadOnlyList<ContactAnnotation>> FindAnnotationsByRemoteIdAsync(String remoteId)Public Function FindAnnotationsByRemoteIdAsync(remoteId As String) As IAsyncOperation( Of IReadOnlyListContactAnnotation )// You can use this method in JavaScript.
Parameters
remoteId
PlatForm::String String String String

The remote ID used to find the ContactAnnotation objects.

Returns
IAsyncOperation<IVectorView<ContactAnnotation>> IAsyncOperation<IReadOnlyList<ContactAnnotation>> IAsyncOperation<IReadOnlyList<ContactAnnotation>> IAsyncOperation<IReadOnlyList<ContactAnnotation>>

The list of ContactAnnotation objects containing the specified remote ID property.

GetAnnotationAsync(String) GetAnnotationAsync(String) GetAnnotationAsync(String) GetAnnotationAsync(String)

Gets the ContactAnnotation with the specified Id.

public : IAsyncOperation<ContactAnnotation> GetAnnotationAsync(PlatForm::String annotationId)public IAsyncOperation<ContactAnnotation> GetAnnotationAsync(String annotationId)Public Function GetAnnotationAsync(annotationId As String) As IAsyncOperation( Of ContactAnnotation )// You can use this method in JavaScript.
Parameters
annotationId
PlatForm::String String String String

The ContactAnnotation.Id used to identify the ContactAnnotation.

Returns

TrySaveAnnotationAsync(ContactAnnotation) TrySaveAnnotationAsync(ContactAnnotation) TrySaveAnnotationAsync(ContactAnnotation) TrySaveAnnotationAsync(ContactAnnotation)

Asynchronously attempts to save the ContactAnnotation to the ContactAnnotationList.

public : IAsyncOperation<PlatForm::Boolean> TrySaveAnnotationAsync(ContactAnnotation annotation)public IAsyncOperation<bool> TrySaveAnnotationAsync(ContactAnnotation annotation)Public Function TrySaveAnnotationAsync(annotation As ContactAnnotation) As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Parameters
annotation
ContactAnnotation ContactAnnotation ContactAnnotation ContactAnnotation

The annotation to save to the list.

Returns

True if the save was successful, otherwise false.

See Also