Ejemplo n.º 1
0
        public static FarmConnectionInfo Parse(string paramsWithDelemiter)
        {
            var connectionItems = paramsWithDelemiter.Split(',');

            if (connectionItems.Length < 5)
            {
                return(null);
            }

            var farm = new FarmConnectionInfo(connectionItems);

            if (farm.Host.Contains("#"))
            {
                return(null);
            }

            return(farm);
        }
Ejemplo n.º 2
0
        public static IList <FarmConnectionInfo> LoadFromFile(string pathAndFileName)
        {
            var result = new List <FarmConnectionInfo>();

            using (var reader = new StreamReader(pathAndFileName))
            {
                string inputString;
                while ((inputString = reader.ReadLine()) != null)
                {
                    var farmConnection = FarmConnectionInfo.Parse(inputString);

                    if (farmConnection != null)
                    {
                        result.Add(farmConnection);
                    }
                }
            }

            return(result);
        }