using System; using System.ComponentModel.Composition; using System.Diagnostics; using System.Diagnostics.Contracts; using System.IO; using Pithos.Interfaces; namespace Pithos.ShellExtensions { [Export(typeof(IStatusChecker))] public class TestStatusChecker:IStatusChecker { [Import] private IPithosSettings Settings; private readonly string[] _states = {"Normal", "Modified", "Conflict","Synch"}; public string GetFileStatus(string path) { Contract.Requires(!String.IsNullOrWhiteSpace(path)); var pithosPath = Settings.PithosPath; if (path.StartsWith(pithosPath,true,null)) { var fileName = Path.GetFileName(path); if (String.IsNullOrWhiteSpace(fileName)) return _states[0]; var status = Char.ConvertToUtf32(fileName, 0)%4; return _states[status]; } return String.Empty; } } }