Finished account wizard that allows adding an account either by logging to the Pithos...
[pithos-ms-client] / trunk / Pithos.Client.WPF / Shell / AboutViewModel.cs
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 string Bits { get; set; }
32
33         public AboutViewModel()
34         {
35             Assembly assembly = Assembly.GetExecutingAssembly();
36
37             var attributes=assembly.GetCustomAttributes(false);
38             var versionAtt = attributes.OfType<AssemblyInformationalVersionAttribute>().First();
39             Released = DateTime.Parse(versionAtt.InformationalVersion);
40             
41             var fileVersion = FileVersionInfo.GetVersionInfo(assembly.Location);                        
42             Version = fileVersion.FileVersion;
43
44             Bits = Environment.Is64BitProcess ? "64 bit" : "32 bit";
45         }
46
47         public void CloseAbout()
48         {
49             this.TryClose();
50         }
51     }
52 }