Statistics
| Branch: | Revision:

root / trunk / Pithos.Client.WPF / Shell / AboutViewModel.cs @ 4b0a2fc0

History | View | Annotate | Download (1.3 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.Reflection;
9
using Caliburn.Micro;
10

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

    
26
        public string Released { get; set; }
27

    
28
        public Uri SupportPage { get; set; }
29

    
30
        public AboutViewModel()
31
        {
32
            var attributes=Assembly.GetExecutingAssembly().GetCustomAttributes(false);
33
            var versionAtt = attributes.OfType<AssemblyInformationalVersionAttribute>().First();
34
            var fileVersion = attributes.OfType<AssemblyFileVersionAttribute>().First();
35

    
36
            Released = versionAtt.InformationalVersion;
37
            Version = fileVersion.Version;
38
        }
39

    
40
        public void Close()
41
        {
42
            this.TryClose();
43
        }
44
    }
45
}