Cloud Storage Integrator 2016 .NET Edition
Cloud Storage Integrator 2016 .NET Edition
Questions / Feedback?

ListChanges Method

Lists changes for a user.

Syntax

[VB.NET]
Public Sub ListChanges()
[C#]
public void ListChanges();

Remarks

This method lists changes to files that are available to a user. This can be used to check if any new changes are reported while working with a file. This allows you to be sure you are working with the most up to date version of a file.

When ListChanges is called, it will use the change marker stored in either ChangeMarker or NextChangeMarker (only one can be populated at a time) to request the next page of changes.

If there are more changes available to list after a call to ListChanges returns, the ChangeMarker property will be populated. If there aren't any more changes available to list, the NextChangeMarker property will be populated instead.

Calling GetCurrentChangeMarker will immediately populate NextChangeMarker. Regardless of whether it is populated because of a call to GetCurrentChangeMarker or to ListChanges, NextChangeMarker is always populated with a value that (at the time of population) points to the most current state. (Since "the most current state" implies that there are no further changes to list, calling ListChanges immediately after NextChangeMarker is populated will not return any further changes.)

Setting ChangeMarker to "1" will cause ListChanges to list changes beginning with the very first change available.

Calling this method will fire the ChangeList event once for each change, and also will populate the Changes collection .

Example of Listing Changes

// Start listing changes from the beginning, and list a maximum of 10 changes at a time.
gdrive.ChangeMarker = "1";
gdrive.Config("MaxResults=10");

// List changes once.
gdrive.ListChanges();
do {
  for (int i = 0; i < gdrive.Changes.Count; i++) {
    Console.WriteLine(gdrive.Changes[i].ResourceId);
    Console.WriteLine(gdrive.Changes[i].Time);
    Console.WriteLine(gdrive.Changes[i].Removed);
  }
  // Continue to call ListChanges() until ChangeMarker is the empty string (indicating there
  // are no more changes to list).
  gdrive.ListChanges();
} while (gdrive.ChangeMarker.Length > 0);

// Now NextChangeMarker will be populated. If we were to call ListChanges() again right now,
// nothing would be listed and NextChangeMarker would still be populated.

// Wait 2 minutes and then try to list changes again.
Thread.Sleep(120000);
gdrive.ListChanges();
do {
  for (int i = 0; i < gdrive.Changes.Count; i++) {
    Console.WriteLine(gdrive.Changes[i].ResourceId);
    Console.WriteLine(gdrive.Changes[i].Time);
    Console.WriteLine(gdrive.Changes[i].Removed);
  }
  gdrive.ListChanges();
} while (gdrive.ChangeMarker.Length > 0);

 
 
Copyright (c) 2019 /n software inc. - All rights reserved.
Cloud Storage Integrator 2016 .NET Edition - Version 16.0 [Build 7239]