void OnDelete() { if (File.Exists(FileName)) { if (Shell32.FileOperation(FileName, FileOperationType.Delete, 0) != 0) { return; } } // Remove from List RemoveRequested?.Invoke(); }
public bool DeleteFile(string filePath) { return(Shell32.FileOperation(filePath, FileOperationType.Delete, 0) == 0); }