~cafg10/bazaarsharp/trunk

« back to all changes in this revision

Viewing changes to BzrSharp/Commands/Move.cs

  • Committer: Carlos Flores
  • Date: 2010-06-06 19:07:30 UTC
  • Revision ID: cafg10@gmail.com-20100606190730-bovboh9wk4tsxhb8
Changes to move and add commands to correctly handle the new URI arguments system

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
            this.destination = new Uri(destination.FullName);
35
35
        }
36
36
 
 
37
        public Move(DirectoryInfo directory, IEnumerable<FileSystemInfo> files, string destination)
 
38
            : base(directory, files)
 
39
        {
 
40
            name = "move";
 
41
            this.destination = new Uri(destination);
 
42
        }
 
43
 
 
44
        public Move(DirectoryInfo directory, IEnumerable<string> files, string destination)
 
45
            : base(directory, files)
 
46
        {
 
47
            name = "move";
 
48
            this.destination = new Uri(destination);
 
49
        }
 
50
 
 
51
        public Move(string directory, IEnumerable<string> files, string destination)
 
52
            : base(directory, files)
 
53
        {
 
54
            name = "move";
 
55
            this.destination = new Uri(destination);
 
56
        }
 
57
 
 
58
        public Move(Uri directory, IEnumerable<Uri> files, string destination)
 
59
            : base(directory, files)
 
60
        {
 
61
            name = "move";
 
62
            this.destination = new Uri(destination);
 
63
        }
 
64
 
 
65
        public Move(Uri directory, IEnumerable<Uri> files, Uri destination)
 
66
            : base(directory, files)
 
67
        {
 
68
            name = "move";
 
69
            this.destination = destination;
 
70
        }
 
71
 
 
72
        public Move(DirectoryInfo directory, IList<string> files, FileSystemInfo destination)
 
73
            : base(directory, files)
 
74
        {
 
75
            name = "move";
 
76
            this.destination = new Uri(destination.FullName);
 
77
        }
 
78
 
37
79
        public override IList<string> Arguments
38
80
        {
39
81
            get
40
82
            {
41
83
                IList<string> arguments = base.Arguments;
42
 
                arguments.Add(destination.AbsoluteUri);
 
84
                arguments.Add(destination.LocalPath);
43
85
                return arguments;
44
86
            }
45
87
        }
49
91
            if (ValidArguments)
50
92
            {
51
93
                var client = ObjectFactory.GetInstance<IClient>();
52
 
                response = new Response(client.RunCommand(Arguments.ToArray(), workingDirectory.AbsoluteUri));
 
94
                response = new Response(client.RunCommand(Arguments.ToArray(), workingDirectory.AbsolutePath));
53
95
                return Results;
54
96
            }
55
97
            else
56
98
            {
57
 
                string arguments = "";
 
99
                string arguments = String.Empty;
58
100
                foreach (string argument in Arguments)
59
101
                {
60
102
                    arguments += argument;
69
111
            {
70
112
                if (files.Count > 1)
71
113
                {
72
 
                    return Directory.Exists(destination.AbsoluteUri);
 
114
                    return Directory.Exists(destination.AbsolutePath);
73
115
                }
74
116
                return true;
75
117
            }