root / trunk / NetSparkle / NetSparkleAssemblyDiagnosticsAccessor.cs @ 049333d2
History | View | Annotate | Download (2.1 kB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.Diagnostics; |
4 |
using System.Linq; |
5 |
using System.Text; |
6 |
using System.Reflection; |
7 |
using System.IO; |
8 |
using AppLimit.NetSparkle.Interfaces; |
9 |
|
10 |
namespace AppLimit.NetSparkle |
11 |
{ |
12 |
public class NetSparkleAssemblyDiagnosticsAccessor : INetSparkleAssemblyAccessor |
13 |
{ |
14 |
private string fileVersion; |
15 |
private string productVersion; |
16 |
private string productName; |
17 |
private string companyName; |
18 |
private string legalCopyright; |
19 |
private string fileDescription; |
20 |
|
21 |
public NetSparkleAssemblyDiagnosticsAccessor(String assemblyName) |
22 |
{ |
23 |
if (assemblyName != null) |
24 |
{ |
25 |
fileVersion = FileVersionInfo.GetVersionInfo(assemblyName).FileVersion; |
26 |
productVersion = FileVersionInfo.GetVersionInfo(assemblyName).ProductVersion; |
27 |
productName = FileVersionInfo.GetVersionInfo(assemblyName).ProductName; |
28 |
companyName = FileVersionInfo.GetVersionInfo(assemblyName).CompanyName; |
29 |
legalCopyright = FileVersionInfo.GetVersionInfo(assemblyName).LegalCopyright; |
30 |
fileDescription = FileVersionInfo.GetVersionInfo(assemblyName).FileDescription; |
31 |
} |
32 |
} |
33 |
|
34 |
#region Assembly Attribute Accessors |
35 |
|
36 |
public string AssemblyTitle |
37 |
{ |
38 |
get |
39 |
{ |
40 |
return productName; |
41 |
} |
42 |
} |
43 |
|
44 |
public string AssemblyVersion |
45 |
{ |
46 |
get |
47 |
{ |
48 |
return fileVersion; |
49 |
} |
50 |
} |
51 |
|
52 |
public string AssemblyDescription |
53 |
{ |
54 |
get { return fileDescription; } |
55 |
} |
56 |
|
57 |
public string AssemblyProduct |
58 |
{ |
59 |
get |
60 |
{ |
61 |
return productVersion; |
62 |
} |
63 |
} |
64 |
|
65 |
public string AssemblyCopyright |
66 |
{ |
67 |
get { return legalCopyright; } |
68 |
} |
69 |
|
70 |
public string AssemblyCompany |
71 |
{ |
72 |
get |
73 |
{ |
74 |
return companyName; |
75 |
} |
76 |
} |
77 |
#endregion |
78 |
} |
79 |
} |