Statistics
| Branch: | Revision:

root / trunk / Pithos.ShellExtensions / ShellStatusChecker.cs @ b5061ac8

History | View | Annotate | Download (1.4 kB)

1
// -----------------------------------------------------------------------
2
// <copyright file="ShellStatusChecker.cs" company="Microsoft">
3
// TODO: Update copyright text.
4
// </copyright>
5
// -----------------------------------------------------------------------
6

    
7
using System.ComponentModel.Composition;
8
using System.Diagnostics;
9
using System.ServiceModel;
10
using Microsoft.Win32;
11
using Pithos.Interfaces;
12

    
13
namespace Pithos.ShellExtensions
14
{
15
    using System;
16
    using System.Collections.Generic;
17
    using System.Linq;
18
    using System.Text;
19

    
20
    /// <summary>
21
    /// TODO: Update summary.
22
    /// </summary>
23
    [Export(typeof(IStatusChecker))]
24
    public class ShellStatusChecker:IStatusChecker
25
    {
26
        [Import]
27
        public IPithosSettings Settings { get; set; }
28

    
29
        public FileOverlayStatus GetFileOverlayStatus(string path)
30
        {
31

    
32
            try
33
            {
34
                using (var client = PithosHost.GetStatusClient())
35
                {
36
                    var status = client.GetStatus(path);
37
                    return status;
38
                }
39
            }
40
            catch (Exception exc)
41
            {
42
                Trace.TraceError(exc.ToString());
43
                return FileOverlayStatus.Unversioned;
44
            }
45
        }
46

    
47
        //Not Used by the shell extensions
48
        public PithosStatus GetPithosStatus()
49
        {
50
            throw new NotSupportedException();
51
        }
52
    }
53
}