Discuss this help topic in SecureBlackbox Forum

Clouds: Delete and restore folder

  1. Obtain the instance of TElGoogleDriveFolder for the folder, which you want to delete.
  2. If you wish just to move the folder to trash, call its Trash() method. After calling this method the object remains functional and you still able to call its methods. It's possible to restore the folder back from trash by calling its Untrash() method. The folder will be restored in the same parent folder from which it was moved to trash.
  3. In order to permanently delete the folder call its Delete() method. After calling this method, the object is freed/disposed, thus other method(s) of this object MUST NOT be called, Otherwise you'll get an exception.

C#:


TElGoogleDriveDataStorage storage = new TElGoogleDriveDataStorage();
...
// get an object for the folder by its ID
TElGoogleDriveFolder folder = storage.AcquireObject(@"...") as TElGoogleDriveFolder;
Console.WriteLine("Folder: {0} (trashed: {1})", folder.Name, folder.Trashed);

// mark the folder as trashed
folder.Trash();
Console.WriteLine("Folder: {0} (trashed: {1})", folder.Name, folder.Trashed);

// removed the trashed mark
folder.Untrash();
Console.WriteLine("Folder: {0} (trashed: {1})", folder.Name, folder.Trashed);

// permanently delete the folder and dispose the folder object
folder.Delete();

How To articles about Google Drive cloud

Discuss this help topic in SecureBlackbox Forum