StorageLibraryChangeTrackerOptions.TrackChangeDetails Property

Definition

Used to determine if the system will track each individual change or just the last change id for a given change tracker.

public:
 property bool TrackChangeDetails { bool get(); void set(bool value); };
bool TrackChangeDetails();

void TrackChangeDetails(bool value);
public bool TrackChangeDetails { get; set; }
var boolean = storageLibraryChangeTrackerOptions.trackChangeDetails;
storageLibraryChangeTrackerOptions.trackChangeDetails = boolean;
Public Property TrackChangeDetails As Boolean

Property Value

Boolean

bool

A boolean value that determines if the change tracker should track all change details or just the last change id. If not set or modified, this defaults to true.

Examples

// applications are expected to persist the previous value
UINT64 appsLastPersistedChangeId = StorageLibraryLastChangeId::Unknown();
StorageFolder folder = StorageFolder::GetFolderFromPathAsync(L"my folder path").get();

StorageLibraryChangeTracker tracker = folder.TryGetChangeTracker();
if (tracker != nullptr)
{
StorageLibraryChangeTrackerOptions ops;
ops.TrackChangeDetails(false);
tracker.Enable(ops);

StorageLibraryChangeReader reader = tracker.GetChangeReader();
if (reader != nullptr)
{
    UINT32 changeId = reader.GetLastChangeId();
    if ((changeId == StorageLibraryLastChangeId::Unknown())
    {
        ScanFolderSlow();
    }
    else if (changeId == 0)
    {
        // no changes in the storage folder yet, OR nothing has changed
        ProcessNormalApplicationStartup();
    }
    else if (changeId != appsLastPersistedChangeId)
    {
        // There have been new changes since we’ve last ran, process them
        appsLastPersistedChangeId = changeId;
        ScanFolderForChanges();
    }
    else
    {
        // changeId and our last persisted change id match, also normal application startup
        ProcessNormalApplicationStartup();
    }
}
}

Remarks

TrackChangeDetails is true by default for all change trackers. You can set this to false when passed to StorageLibraryChangeTracker::EnableWithOptions in order to save on system storage if the application is only concerned about the last change id, and not details about each individual change.

Applies to

See also