1
0
mirror of https://github.com/Ylianst/MeshCentralRouter synced 2025-12-14 23:33:35 +00:00

Added custom app support.

This commit is contained in:
Ylian Saint-Hilaire
2022-05-12 16:07:33 -07:00
parent 95d1a442be
commit bf668eae23
19 changed files with 6885 additions and 431 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
using System;
using System.Net;
using System.Windows.Forms;
using System.Collections.Generic;
namespace MeshCentralRouter
{
@@ -46,13 +47,25 @@ namespace MeshCentralRouter
if (x == 3) { return 4; } // PuTTY
if (x == 4) { return 3; } // RDP
if (x == 5) { return 5; } // WinSCP
return x;
return 0;
}
public string getAppIdStr()
{
int x = (int)appComboBox.SelectedIndex;
if (x < 6) { return null; } // Custom or pre-defined
return apps[x - 6][1];
}
public NodeClass getNode() { return (NodeClass)nodeComboBox.SelectedItem; }
public void setNode(NodeClass node) { selectedNode = node; }
private List<String[]> apps = null;
private void AddRelayMapForm_Load(object sender, EventArgs e)
{
// Add any custom applications
apps = Settings.GetApplications();
if (apps != null) { foreach (String[] app in apps) { appComboBox.Items.Add(app[0]); } }
if (selectedNode == null)
{
// Fill the groups