Statistics
| Branch: | Revision:

root / trunk / Pithos.Client.WPF / Utils / FileUtils.cs @ f5cdce9f

History | View | Annotate | Download (851 Bytes)

1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.IO;
6

    
7
namespace Pithos.Client.WPF.Utils
8
{
9
    public static class FileUtils
10
    {
11
        //actionType = true for copy, false for move
12
        public static bool FileCopyMove(string[] files, string targetDir, bool actionType) 
13
        {
14
            
15
            foreach (string file in files)
16
            {
17
                if (System.IO.File.Exists(file))
18
                {
19
                    System.IO.File.Copy(file, System.IO.Path.Combine(targetDir, System.IO.Path.GetFileName(file)));
20

    
21
                    return true;
22
                }
23
                else
24
                {
25
                    //Send to Errorlog
26
                    return false;
27
                }
28
                    
29
            }
30
            return true;
31
        }
32
    }
33
}