root / trunk / Pithos.Client.WPF / Shell / AboutViewModel.cs @ 6b0de454
History | View | Annotate | Download (3.1 kB)
1 | 255f5f86 | Panagiotis Kanavos | #region |
---|---|---|---|
2 | 255f5f86 | Panagiotis Kanavos | /* ----------------------------------------------------------------------- |
3 | 255f5f86 | Panagiotis Kanavos | * <copyright file="AboutViewModel.cs" company="GRNet"> |
4 | 255f5f86 | Panagiotis Kanavos | * |
5 | 255f5f86 | Panagiotis Kanavos | * Copyright 2011-2012 GRNET S.A. All rights reserved. |
6 | 255f5f86 | Panagiotis Kanavos | * |
7 | 255f5f86 | Panagiotis Kanavos | * Redistribution and use in source and binary forms, with or |
8 | 255f5f86 | Panagiotis Kanavos | * without modification, are permitted provided that the following |
9 | 255f5f86 | Panagiotis Kanavos | * conditions are met: |
10 | 255f5f86 | Panagiotis Kanavos | * |
11 | 255f5f86 | Panagiotis Kanavos | * 1. Redistributions of source code must retain the above |
12 | 255f5f86 | Panagiotis Kanavos | * copyright notice, this list of conditions and the following |
13 | 255f5f86 | Panagiotis Kanavos | * disclaimer. |
14 | 255f5f86 | Panagiotis Kanavos | * |
15 | 255f5f86 | Panagiotis Kanavos | * 2. Redistributions in binary form must reproduce the above |
16 | 255f5f86 | Panagiotis Kanavos | * copyright notice, this list of conditions and the following |
17 | 255f5f86 | Panagiotis Kanavos | * disclaimer in the documentation and/or other materials |
18 | 255f5f86 | Panagiotis Kanavos | * provided with the distribution. |
19 | 255f5f86 | Panagiotis Kanavos | * |
20 | 255f5f86 | Panagiotis Kanavos | * |
21 | 255f5f86 | Panagiotis Kanavos | * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS |
22 | 255f5f86 | Panagiotis Kanavos | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
23 | 255f5f86 | Panagiotis Kanavos | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
24 | 255f5f86 | Panagiotis Kanavos | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR |
25 | 255f5f86 | Panagiotis Kanavos | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
26 | 255f5f86 | Panagiotis Kanavos | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
27 | 255f5f86 | Panagiotis Kanavos | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
28 | 255f5f86 | Panagiotis Kanavos | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
29 | 255f5f86 | Panagiotis Kanavos | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
30 | 255f5f86 | Panagiotis Kanavos | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
31 | 255f5f86 | Panagiotis Kanavos | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
32 | 255f5f86 | Panagiotis Kanavos | * POSSIBILITY OF SUCH DAMAGE. |
33 | 255f5f86 | Panagiotis Kanavos | * |
34 | 255f5f86 | Panagiotis Kanavos | * The views and conclusions contained in the software and |
35 | 255f5f86 | Panagiotis Kanavos | * documentation are those of the authors and should not be |
36 | 255f5f86 | Panagiotis Kanavos | * interpreted as representing official policies, either expressed |
37 | 255f5f86 | Panagiotis Kanavos | * or implied, of GRNET S.A. |
38 | 255f5f86 | Panagiotis Kanavos | * </copyright> |
39 | 255f5f86 | Panagiotis Kanavos | * ----------------------------------------------------------------------- |
40 | 255f5f86 | Panagiotis Kanavos | */ |
41 | 255f5f86 | Panagiotis Kanavos | #endregion |
42 | d53bbdf0 | Panagiotis Kanavos | using System.ComponentModel.Composition; |
43 | 2f41824c | Panagiotis Kanavos | using System.Diagnostics; |
44 | 4b0a2fc0 | Panagiotis Kanavos | using System.Reflection; |
45 | d53bbdf0 | Panagiotis Kanavos | using Caliburn.Micro; |
46 | d53bbdf0 | Panagiotis Kanavos | |
47 | d53bbdf0 | Panagiotis Kanavos | namespace Pithos.Client.WPF.Shell |
48 | d53bbdf0 | Panagiotis Kanavos | { |
49 | d53bbdf0 | Panagiotis Kanavos | using System; |
50 | d53bbdf0 | Panagiotis Kanavos | using System.Collections.Generic; |
51 | d53bbdf0 | Panagiotis Kanavos | using System.Linq; |
52 | d53bbdf0 | Panagiotis Kanavos | using System.Text; |
53 | 4b0a2fc0 | Panagiotis Kanavos | |
54 | d53bbdf0 | Panagiotis Kanavos | /// <summary> |
55 | d53bbdf0 | Panagiotis Kanavos | /// TODO: Update summary. |
56 | d53bbdf0 | Panagiotis Kanavos | /// </summary> |
57 | d53bbdf0 | Panagiotis Kanavos | [Export(typeof(AboutViewModel))] |
58 | d53bbdf0 | Panagiotis Kanavos | public class AboutViewModel:Screen |
59 | d53bbdf0 | Panagiotis Kanavos | { |
60 | d53bbdf0 | Panagiotis Kanavos | public string Version { get; set; } |
61 | 6b0de454 | Panagiotis Kanavos | |
62 | 6b0de454 | Panagiotis Kanavos | public string LatestVersion { get; set; } |
63 | 6b0de454 | Panagiotis Kanavos | public string LatestRelease { get; set; } |
64 | 4b0a2fc0 | Panagiotis Kanavos | |
65 | 2f41824c | Panagiotis Kanavos | public DateTime Released { get; set; } |
66 | 4b0a2fc0 | Panagiotis Kanavos | |
67 | 4b0a2fc0 | Panagiotis Kanavos | public Uri SupportPage { get; set; } |
68 | 4b0a2fc0 | Panagiotis Kanavos | |
69 | d17258c2 | Panagiotis Kanavos | public string Bits { get; set; } |
70 | d17258c2 | Panagiotis Kanavos | |
71 | 4b0a2fc0 | Panagiotis Kanavos | public AboutViewModel() |
72 | d53bbdf0 | Panagiotis Kanavos | { |
73 | 2f41824c | Panagiotis Kanavos | Assembly assembly = Assembly.GetExecutingAssembly(); |
74 | 4b0a2fc0 | Panagiotis Kanavos | |
75 | 2f41824c | Panagiotis Kanavos | var attributes=assembly.GetCustomAttributes(false); |
76 | 2f41824c | Panagiotis Kanavos | var versionAtt = attributes.OfType<AssemblyInformationalVersionAttribute>().First(); |
77 | 2f41824c | Panagiotis Kanavos | Released = DateTime.Parse(versionAtt.InformationalVersion); |
78 | 2f41824c | Panagiotis Kanavos | |
79 | 2f41824c | Panagiotis Kanavos | var fileVersion = FileVersionInfo.GetVersionInfo(assembly.Location); |
80 | 2f41824c | Panagiotis Kanavos | Version = fileVersion.FileVersion; |
81 | d17258c2 | Panagiotis Kanavos | |
82 | d17258c2 | Panagiotis Kanavos | Bits = Environment.Is64BitProcess ? "64 bit" : "32 bit"; |
83 | d53bbdf0 | Panagiotis Kanavos | } |
84 | d53bbdf0 | Panagiotis Kanavos | |
85 | 3ddbb7b8 | Panagiotis Kanavos | public void CloseAbout() |
86 | d53bbdf0 | Panagiotis Kanavos | { |
87 | 4b0a2fc0 | Panagiotis Kanavos | this.TryClose(); |
88 | d53bbdf0 | Panagiotis Kanavos | } |
89 | d53bbdf0 | Panagiotis Kanavos | } |
90 | d53bbdf0 | Panagiotis Kanavos | } |