コード例 #1
0
        public SmartphoneList GetByManufacturer(string manufacturer)
        {
            SmartphoneList spList = new SmartphoneList();

            foreach (Smartphone listSp in this)
            {
                if (listSp.Manufacturer.Equals(manufacturer))
                {
                    spList.Add(listSp);
                }
            }

            return(spList);
        }
コード例 #2
0
        public SmartphoneList Deserialize(string path)
        {
            SmartphoneList deserialized = new SmartphoneList();

            using (StreamReader streamR = new StreamReader(@path))
                using (CsvReader serializer = new CsvReader(streamR))
                {
                    foreach (Smartphone listSp in serializer.GetRecords <Smartphone>())
                    {
                        deserialized.Add(listSp);
                    }

                    return(deserialized);
                }
        }