aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.TFS/AttachementHandler.cs
blob: 4eb08d407e6652585704a0321ef59d7a2e3c0f2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.TFS
{
    public class AttachementHandler
    {
        private Action<String> _downloadAction;

        public String Name { get; set; }
        public string Comment { get; set; }
        public DateTime AttachedTimeUtc { get; set; }
        public string Extension { get; set; }
        public string FileGuid { get; set; }
        public long Length { get; set; }

        internal AttachementHandler(Action<String> downloadAction)
        {
            _downloadAction = downloadAction;
        }

        public Task Download(String targetFile)
        {
            return Task.Factory.StartNew(() => 
            {
                _downloadAction(targetFile);
            });
        }
    }
}