Esempio n. 1
0
        public async Task <IEnumerable <Serial> > GetSerials(string filter = null)
        {
            var dirs = Directory.GetDirectories(m_Path);

            var serials = new List <Serial>();

            foreach (var dir in dirs)
            {
                try
                {
                    var serial = LocalSerial.LoadFrom(dir);
                    serials.Add(new Serial(serial.Title, serial.Description, serial));
                }
                catch
                {
                }
            }

            if (filter != null)
            {
                serials = serials.FindAll(s => s.Title.Contains(filter.ToLower()));
            }

            return(serials);
        }
Esempio n. 2
0
        private void AddSerial(SerialDescriptor descriptor)
        {
            string directoryPath = m_Path + "/" + descriptor.Title;

            Directory.CreateDirectory(directoryPath);

            LocalSerial.SaveDescriptor(directoryPath, descriptor);
        }