-> PortScanner added

This commit is contained in:
Kevin Krüger
2022-01-18 09:14:22 +01:00
parent f7b63cb8e1
commit a07655faed
18 changed files with 1301 additions and 9 deletions

View File

@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// This class represents one item in the list of items that will be
// displayed in the timeout time combo box in the MainWindow
namespace PortScanner
{
class TimeoutListItem
{
// DisplayMember: the string that will be displayed in the timeout combo box
// ValueMember: the actual ms value attached to that string
public string DisplayMember { get; set; }
public int ValueMember { get; set; }
// The array of different values present in the combo box
// Add new values right here ......
private static int[] _times =
{
500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000
};
// Returns a list of objects of this class intended to be used
// as a datasource for a combo box
public static List<TimeoutListItem> CreateTimeoutListItems()
{
var returnList = new List<TimeoutListItem>();
for (int i = 0; i < _times.Length; i++)
{
returnList.Add(new TimeoutListItem
{
DisplayMember = String.Format("{0} ms", _times[i]),
ValueMember = _times[i]
});
}
return returnList;
}
}
}