Changes for directories
[pithos-ms-client] / trunk / Pithos.Core / WorkflowState.cs
1 using System;
2 using System.Collections.Generic;
3 using System.IO;
4 using System.Linq;
5 using System.Text;
6 using Pithos.Interfaces;
7 using Pithos.Network;
8
9 namespace Pithos.Core
10 {
11     public class WorkflowState
12     {
13         public AccountInfo AccountInfo { get; set; }
14
15         public string Path { get; set; }
16         public string FileName { get; set; }
17         
18         public string OldPath { get; set; }
19         public string OldFileName{ get; set; }
20
21         public WatcherChangeTypes TriggeringChange { get; set; }
22         public FileStatus Status { get; set; }
23         
24         public bool Skip { get; set; }
25
26         public string Hash { get; set; }
27         public string LastUpdateHash { get; set; }
28
29 /*
30         public WorkflowState(AccountInfo accountInfo)
31         {
32             AccountInfo = accountInfo;
33         }
34 */
35
36         public WorkflowState()
37         {
38             
39         }
40
41         public WorkflowState(AccountInfo accountInfo, FileState state)
42         {
43             AccountInfo = accountInfo;
44             Path = state.FilePath.ToLower();
45             FileName = System.IO.Path.GetFileName(state.FilePath).ToLower();
46             Hash = state.Checksum;
47             Status = state.OverlayStatus == FileOverlayStatus.Unversioned
48                          ? FileStatus.Created
49                          : state.FileStatus;
50             TriggeringChange =
51                 state.OverlayStatus == FileOverlayStatus.Unversioned
52                     ? WatcherChangeTypes.Created
53                     : WatcherChangeTypes.Changed;
54         }
55
56     }
57 }