forked from BornToBeRoot/NETworkManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomCommand.cs
More file actions
35 lines (33 loc) · 1.37 KB
/
Copy pathCustomCommand.cs
File metadata and controls
35 lines (33 loc) · 1.37 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
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace NETworkManager.Utilities
{
/// <summary>
/// Class provides static methods to manage custom commands.
/// </summary>
public static class CustomCommand
{
/// <summary>
/// Method returns a list of default custom commands (see <see cref="CustomCommandInfo"/>.
/// </summary>
/// <returns>List with <see cref="CustomCommandInfo"/>s.</returns>
public static List<CustomCommandInfo> GetDefaults() => new List<CustomCommandInfo>
{
new CustomCommandInfo(Guid.NewGuid(), "Internet Explorer", "iexplore.exe", @"http://$$ipaddress$$/"),
new CustomCommandInfo(Guid.NewGuid(), "Internet Explorer (https)", "iexplore.exe", @"https://$$ipaddress$$/"),
new CustomCommandInfo(Guid.NewGuid(), "Windows Explorer (c$)", "explorer.exe", @"\\$$ipaddress$$\c$"),
};
/// <summary>
/// Method to execute a <see cref="CustomCommandInfo"/>.
/// </summary>
/// <param name="info"><see cref="CustomCommandInfo"/> which is executed.</param>
public static void Run(CustomCommandInfo info)
{
if (string.IsNullOrEmpty(info.Arguments))
Process.Start(info.FilePath);
else
Process.Start(info.FilePath, info.Arguments);
}
}
}