-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.cs
More file actions
57 lines (56 loc) · 1.05 KB
/
Application.cs
File metadata and controls
57 lines (56 loc) · 1.05 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
/*
* Created by SharpDevelop.
* User: scott
* Date: 8/29/2015
* Time: 5:49 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Drawing;
namespace RemoteControl
{
/// <summary>
/// Description of Application.
/// </summary>
public class Application
{
private string _name;
private string _launchPath;
private System.Diagnostics.Process p = null;
public string name {
get {
return _name;
}
}
public string launchPath {
get {
return _launchPath;
}
}
public Icon icon {
get {
if (launchPath != "") return Icon.ExtractAssociatedIcon(launchPath);
else return null;
}
}
public Application(string appName, string launchPath)
{
this._name = appName;
this._launchPath = launchPath;
}
public void launch(){
if (p == null){
p = System.Diagnostics.Process.Start(launchPath);
}
else if (p.HasExited){
p = System.Diagnostics.Process.Start(launchPath);
}
}
public void close(){
if (p != null){
p.Close();
}
}
}
}