// We need this to ignore the instance that represents the edit screen protected List <string> UsedPorts(string instanceName = null) { return(MonitoringInstances .Where(p => string.IsNullOrWhiteSpace(instanceName) || p.Name != instanceName) .Select(p => p.Port.ToString()) .Distinct() .ToList()); }
// We need this to ignore the instance that represents the edit screen protected List <string> UsedPaths(string instanceName = null) { return(MonitoringInstances .Where(p => string.IsNullOrWhiteSpace(instanceName) || p.Name != instanceName) .SelectMany(p => new[] { p.LogPath, p.InstallPath }) .Distinct() .ToList()); }