Repository navigation
Expand file tree
/
Copy pathProgram.cs
More file actions
52 lines (44 loc) · 1.71 KB
/
Copy pathProgram.cs
File metadata and controls
52 lines (44 loc) · 1.71 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
using System.ComponentModel.Composition;
using System.IO;
using System.Reflection;
using GitHub.Models;
using Octokit;
namespace GitHub.VisualStudio
{
// Represents the currently executing program.
[Export(typeof(IProgram))]
public class Program : IProgram
{
public Program()
{
applicationName = Info.ApplicationInfo.ApplicationName;
applicationDescription = Info.ApplicationInfo.ApplicationDescription;
var executingAssembly = typeof(Program).Assembly;
AssemblyName = executingAssembly.GetName();
ExecutingAssemblyDirectory = Path.GetDirectoryName(executingAssembly.Location);
ProductHeader = new ProductHeaderValue(Info.ApplicationInfo.ApplicationSafeName, AssemblyName.Version.ToString());
}
readonly string applicationName;
readonly string applicationDescription;
/// <summary>
/// Name of this application
/// </summary>
public string ApplicationName { get { return applicationName; } }
/// <summary>
/// Name of this application
/// </summary>
public string ApplicationDescription { get { return applicationDescription; } }
/// <summary>
/// The currently executing assembly.
/// </summary>
public AssemblyName AssemblyName { get; private set; }
/// <summary>
/// The directory that contains the currently executing assembly.
/// </summary>
public string ExecutingAssemblyDirectory { get; private set; }
/// <summary>
/// The product header used in the user agent.
/// </summary>
public ProductHeaderValue ProductHeader { get; private set; }
}
}