Statistics
| Branch: | Revision:

root / trunk / Pithos.Client.WPF / Shell / AboutViewModel.cs @ 2f41824c

History | View | Annotate | Download (1.4 kB)

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

    
7
using System.ComponentModel.Composition;
8
using System.Diagnostics;
9
using System.Reflection;
10
using Caliburn.Micro;
11

    
12
namespace Pithos.Client.WPF.Shell
13
{
14
    using System;
15
    using System.Collections.Generic;
16
    using System.Linq;
17
    using System.Text;
18
    
19
    /// <summary>
20
    /// TODO: Update summary.
21
    /// </summary>
22
    [Export(typeof(AboutViewModel))]
23
    public class AboutViewModel:Screen
24
    {
25
        public string Version { get; set; }
26

    
27
        public DateTime Released { get; set; }
28

    
29
        public Uri SupportPage { get; set; }
30

    
31
        public AboutViewModel()
32
        {
33
            Assembly assembly = Assembly.GetExecutingAssembly();
34

    
35
            var attributes=assembly.GetCustomAttributes(false);
36
            var versionAtt = attributes.OfType<AssemblyInformationalVersionAttribute>().First();
37
            Released = DateTime.Parse(versionAtt.InformationalVersion);
38
            
39
            var fileVersion = FileVersionInfo.GetVersionInfo(assembly.Location);                        
40
            Version = fileVersion.FileVersion;
41
        }
42

    
43
        public void Close()
44
        {
45
            this.TryClose();
46
        }
47
    }
48
}