-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbout.cs
More file actions
65 lines (59 loc) · 1.85 KB
/
About.cs
File metadata and controls
65 lines (59 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.ComponentModel.DataAnnotations;
using System.Reflection;
namespace OpenGovApi
{
public static class About
{
public static string Name
{
get
{
var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if (attributes.Length > 0)
{
var titleAttribute = (AssemblyTitleAttribute)attributes[0];
if (titleAttribute.Title.Length > 0)
{
return titleAttribute.Title;
}
}
return String.Empty;
}
}
public static string Version
{
get
{
var Ver = Assembly.GetExecutingAssembly().GetName().Version;
return String.Format("{0}.{1}", Ver.Major, Ver.Minor);
}
}
public static string FullVersion
{
get
{
var Ver = Assembly.GetExecutingAssembly().GetName().Version;
return String.Format("{0}.{1}.{2}", Ver.Major, Ver.Minor, Ver.Build);
}
}
[Display(Name = "Build date")]
[DisplayFormat(DataFormatString = "{0:dddd d MMMM yyyy}")]
public static DateTime BuildDate
{
get
{
var Ver = Assembly.GetExecutingAssembly().GetName().Version;
return new DateTime(2000, 01, 01).AddDays(Ver.Build);
}
}
[Display(Name = "Build date")]
public static string BuildDateAsString
{
get
{
return String.Format("{0:d MMMM yyyy}", BuildDate);
}
}
}
}