/// <summary> /// Deletes an empty directory from a specified path. /// </summary> /// <param name="device">The device.</param> /// <param name="path">The name of the empty directory to remove. This directory must be writable or empty.</param> /// <param name="recursive"><c>true</c> to remove directories, subdirectories, and files in path; otherwise, <c>false</c>.</param> public static void Delete(RemoteDevice device, string path, bool recursive) { if (Exists(device, path)) { if (recursive) { foreach (var file in GetFiles(device, path)) { RemoteFile.Delete(device, file); } foreach (var dir in GetDirectories(device, path)) { Delete(device, dir, true); } } if (0 == device.ISession.CeRemoveDirectory(path)) { device.ThrowRAPIException(); } } }
/// <summary> /// Deletes a file. /// </summary> public override void Delete() { RemoteFile.Delete(Device, FullPath); }