public static bool LoadWithoutError(List <List <string> > stringsFromFile) { List <ItemCatalog> tempCatalog = null; foreach (var item in stringsFromFile) { var toCatalog = ItemCatalog.CreateFromFile(item); if (toCatalog.IsCorrectCreating()) { if (tempCatalog == null) { tempCatalog = new List <ItemCatalog>(); } tempCatalog.Add(toCatalog); } else { return(false); } } Catalog.libraryItem.Clear(); Catalog.libraryItem = new List <ItemCatalog>(tempCatalog); return(true); }
public static void Load(List <List <string> > stringsFromFile) { List <ItemCatalog> tempCatalog = null; foreach (var item in stringsFromFile) { var toCatalog = ItemCatalog.CreateFromFile(item); if (tempCatalog == null) { tempCatalog = new List <ItemCatalog>(); } tempCatalog.Add(toCatalog); } Catalog.libraryItem.Clear(); Catalog.libraryItem = new List <ItemCatalog>(tempCatalog); }
public static void Edit(ItemCatalog itemForEdit, List <string> aboutItemCatalog) { itemForEdit.Create(aboutItemCatalog); }
public static void Add(ItemCatalog item) { Catalog.libraryItem.Add(item); }