مشاركة عبر


StorageFolder.TryGetChangeTracker Method

Definition

Gets the StorageLibraryChangeTracker associated with a StorageFolder.

public:
 virtual StorageLibraryChangeTracker ^ TryGetChangeTracker() = TryGetChangeTracker;
StorageLibraryChangeTracker TryGetChangeTracker();
public StorageLibraryChangeTracker TryGetChangeTracker();
function tryGetChangeTracker()
Public Function TryGetChangeTracker () As StorageLibraryChangeTracker

Returns

The StorageLibraryChangeTracker associated with a StorageFolder.

Windows requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v6.0)

Examples

This example demonstrates getting a StorageLibraryChangeTracker from a StorageFolder, and then enabling the tracker.

private void EnableChangeTracker(StorageFolder folder) 
{ 
    // Get the change tracker object corresponding to the StorageFolder in the parameters 
    StorageLibraryChangeTracker tracker = folder.TryGetChangeTracker(); 
    if (tracker != null) 
    { 
        tracker.Enable(); 
    } 
} 

Applies to

See also