root / trunk / Pithos.Core / IStatusKeeper.cs @ 5bcf6d70
History | View | Annotate | Download (2 kB)
1 |
using System; |
---|---|
2 |
using System.Diagnostics.Contracts; |
3 |
using Pithos.Interfaces; |
4 |
|
5 |
namespace Pithos.Core |
6 |
{ |
7 |
[ContractClass(typeof(IStatusKeeperContract))] |
8 |
public interface IStatusKeeper |
9 |
{ |
10 |
void SetFileOverlayStatus(string path,FileOverlayStatus status); |
11 |
void UpdateFileChecksum(string path, string checksum); |
12 |
void RemoveFileOverlayStatus(string path); |
13 |
void SetFileStatus(string path, FileStatus status); |
14 |
FileStatus GetFileStatus(string path); |
15 |
void ClearFileStatus(string path); |
16 |
void SetPithosStatus(PithosStatus status); |
17 |
} |
18 |
|
19 |
[ContractClassFor(typeof(IStatusKeeper))] |
20 |
public abstract class IStatusKeeperContract : IStatusKeeper |
21 |
{ |
22 |
public void SetFileOverlayStatus(string path, FileOverlayStatus status) |
23 |
{ |
24 |
Contract.Requires(!String.IsNullOrWhiteSpace(path)); |
25 |
} |
26 |
|
27 |
public void UpdateFileChecksum(string path, string checksum) |
28 |
{ |
29 |
Contract.Requires(!String.IsNullOrWhiteSpace(path)); |
30 |
Contract.Requires(checksum!=null); |
31 |
} |
32 |
|
33 |
public void RemoveFileOverlayStatus(string path) |
34 |
{ |
35 |
Contract.Requires(!String.IsNullOrWhiteSpace(path)); |
36 |
} |
37 |
|
38 |
public void RenameFileOverlayStatus(string oldPath, string newPath) |
39 |
{ |
40 |
Contract.Requires(!String.IsNullOrWhiteSpace(oldPath)); |
41 |
Contract.Requires(!String.IsNullOrWhiteSpace(newPath)); |
42 |
|
43 |
} |
44 |
|
45 |
public void SetFileStatus(string path, FileStatus status) |
46 |
{ |
47 |
Contract.Requires(!String.IsNullOrWhiteSpace(path)); |
48 |
} |
49 |
|
50 |
public FileStatus GetFileStatus(string path) |
51 |
{ |
52 |
Contract.Requires(!String.IsNullOrWhiteSpace(path)); |
53 |
|
54 |
return default(FileStatus); |
55 |
} |
56 |
|
57 |
public void ClearFileStatus(string path) |
58 |
{ |
59 |
Contract.Requires(!String.IsNullOrWhiteSpace(path)); |
60 |
} |
61 |
|
62 |
public void SetPithosStatus(PithosStatus status) |
63 |
{ |
64 |
} |
65 |
} |
66 |
} |