Esempio n. 1
0
        /// <summary>
        /// Initialize the storage.
        /// </summary>
        public void Init()
        {
            foreach (var fileName in Directory.GetFiles(_path, "*.csv"))
            {
                var item = new CsvExtendedInfoStorageItem(this, fileName);
                _items.Add(Path.GetFileNameWithoutExtension(fileName), item);

                item.Init();
            }
        }
Esempio n. 2
0
        IExtendedInfoStorageItem IExtendedInfoStorage.Create(string storageName, Tuple <string, Type>[] fields)
        {
            if (storageName.IsEmpty())
            {
                throw new ArgumentNullException(nameof(storageName));
            }

            var fileName = Path.Combine(_path, storageName + ".csv");

            return(_items.SafeAdd(storageName, key =>
            {
                var item = new CsvExtendedInfoStorageItem(this, fileName, fields);
                item.Init();
                return item;
            }));
        }