private static bool Send(string path, FileOperationAPIWrapper.FileOperationFlags flags)
        {
            bool flag;
            try
            {
                FileOperationAPIWrapper.SHFILEOPSTRUCT sHFILEOPSTRUCT = new FileOperationAPIWrapper.SHFILEOPSTRUCT()
                {
                    wFunc = FileOperationAPIWrapper.FileOperationType.FO_DELETE,
                    pFrom = string.Concat(path, '\0', '\0'),
                    fFlags = (FileOperationAPIWrapper.FileOperationFlags)((ushort)(FileOperationAPIWrapper.FileOperationFlags.FOF_ALLOWUNDO | flags))
                };
                FileOperationAPIWrapper.SHFILEOPSTRUCT sHFILEOPSTRUCT1 = sHFILEOPSTRUCT;
                //FileOperationAPIWrapper.SHFileOperation(ref sHFILEOPSTRUCT1);
                flag = true;
            }
            catch (Exception)
            {
            #if DEBUG
                throw;
                System.Diagnostics.Debugger.Break();

            #endif
                flag = false;
            }
            return flag;
        }
        private static bool Send(string path, FileOperationAPIWrapper.FileOperationFlags flags)
        {
            bool flag;
            try
            {
                flag = true;
            }
            catch (Exception)
            {
            #if DEBUG
                throw;
                System.Diagnostics.Debugger.Break();

            #endif
                flag = false;
            }
            return flag;
        }
		private static bool DeleteFile(string path, FileOperationAPIWrapper.FileOperationFlags flags)
		{
			bool result;
			try
			{
				FileOperationAPIWrapper.SHFILEOPSTRUCT sHFILEOPSTRUCT = new FileOperationAPIWrapper.SHFILEOPSTRUCT
				{
					wFunc = FileOperationAPIWrapper.FileOperationType.FO_DELETE,
					pFrom = path + '\0' + '\0',
					fFlags = flags
				};
				FileOperationAPIWrapper.SHFileOperation(ref sHFILEOPSTRUCT);
				result = true;
			}
			catch (Exception)
			{
				result = false;
			}
			return result;
		}
Example #4
0
        // Token: 0x0600097F RID: 2431 RVA: 0x003B6800 File Offset: 0x003B4A00
        private static bool DeleteFile(string path, FileOperationAPIWrapper.FileOperationFlags flags)
        {
            bool result;

            try
            {
                FileOperationAPIWrapper.SHFILEOPSTRUCT sHFILEOPSTRUCT = new FileOperationAPIWrapper.SHFILEOPSTRUCT
                {
                    wFunc  = FileOperationAPIWrapper.FileOperationType.FO_DELETE,
                    pFrom  = path + "\0\0",
                    fFlags = flags
                };
                FileOperationAPIWrapper.SHFileOperation(ref sHFILEOPSTRUCT);
                result = true;
            }
            catch (Exception)
            {
                result = false;
            }
            return(result);
        }
 private static bool DeleteCompletelySilent(string path)
 {
     return(FileOperationAPIWrapper.DeleteFile(path, FileOperationAPIWrapper.FileOperationFlags.FOF_SILENT | FileOperationAPIWrapper.FileOperationFlags.FOF_NOCONFIRMATION | FileOperationAPIWrapper.FileOperationFlags.FOF_NOERRORUI));
 }
 public static bool MoveToRecycleBin(string path)
 {
     return(FileOperationAPIWrapper.Send(path, FileOperationAPIWrapper.FileOperationFlags.FOF_SILENT | FileOperationAPIWrapper.FileOperationFlags.FOF_NOCONFIRMATION | FileOperationAPIWrapper.FileOperationFlags.FOF_NOERRORUI));
 }
 private static bool Send(string path)
 {
     return(FileOperationAPIWrapper.Send(path, FileOperationAPIWrapper.FileOperationFlags.FOF_NOCONFIRMATION | FileOperationAPIWrapper.FileOperationFlags.FOF_WANTNUKEWARNING));
 }
Example #8
0
 public static void Delete(string path)
 {
     FileOperationAPIWrapper.MoveToRecycleBin(path);
 }
 private static bool DeleteFile(string path, FileOperationAPIWrapper.FileOperationFlags flags)
 {
     System.IO.File.Delete(path);
     return true;
 }
		private static extern int SHFileOperation(ref FileOperationAPIWrapper.SHFILEOPSTRUCT FileOp);