-
Notifications
You must be signed in to change notification settings - Fork 808
Expand file tree
/
Copy pathPuTTY.cs
More file actions
65 lines (60 loc) · 2.81 KB
/
PuTTY.cs
File metadata and controls
65 lines (60 loc) · 2.81 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 NETworkManager.Models.PuTTY;
using NETworkManager.Settings;
namespace NETworkManager.Profiles.Application;
public static class PuTTY
{
public static PuTTYSessionInfo CreateSessionInfo(ProfileInfo profile)
{
// Get group info
var group = ProfileManager.GetGroupByName(profile.Group);
return new PuTTYSessionInfo
{
Mode = profile.PuTTY_ConnectionMode,
HostOrSerialLine = profile.PuTTY_HostOrSerialLine,
PortOrBaud = profile.PuTTY_OverridePortOrBaud
? profile.PuTTY_PortOrBaud
: Settings.Application.PuTTY.GetPortOrBaudByConnectionMode(profile.PuTTY_ConnectionMode),
Username = profile.PuTTY_OverrideUsername
? profile.PuTTY_Username
: group.PuTTY_OverrideUsername
? group.PuTTY_Username
: SettingsManager.Current.PuTTY_Username,
PrivateKey = profile.PuTTY_OverridePrivateKeyFile
? profile.PuTTY_PrivateKeyFile
: group.PuTTY_OverridePrivateKeyFile
? group.PuTTY_PrivateKeyFile
: SettingsManager.Current.PuTTY_PrivateKeyFile,
Profile = profile.PuTTY_OverrideProfile
? profile.PuTTY_Profile
: group.PuTTY_OverrideProfile
? group.PuTTY_Profile
: SettingsManager.Current.PuTTY_Profile,
Hostkey = profile.PuTTY_OverrideHostkey ? profile.PuTTY_Hostkey : "",
EnableLog = profile.PuTTY_OverrideEnableLog
? profile.PuTTY_EnableLog
: group.PuTTY_OverrideEnableLog
? group.PuTTY_EnableLog
: SettingsManager.Current.PuTTY_EnableSessionLog,
LogMode = profile.PuTTY_OverrideLogMode
? profile.PuTTY_LogMode
: group.PuTTY_OverrideLogMode
? group.PuTTY_LogMode
: SettingsManager.Current.PuTTY_LogMode,
LogPath = profile.PuTTY_OverrideLogPath
? profile.PuTTY_LogPath
: group.PuTTY_OverrideLogPath
? group.PuTTY_LogPath
: Settings.Application.PuTTY.LogPath,
LogFileName = profile.PuTTY_OverrideLogFileName
? profile.PuTTY_LogFileName
: group.PuTTY_OverrideLogFileName
? group.PuTTY_LogFileName
: SettingsManager.Current.PuTTY_LogFileName,
AdditionalCommandLine = profile.PuTTY_OverrideAdditionalCommandLine
? profile.PuTTY_AdditionalCommandLine
: group.PuTTY_OverrideAdditionalCommandLine
? group.PuTTY_AdditionalCommandLine
: SettingsManager.Current.PuTTY_AdditionalCommandLine
};
}
}