Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public static void Edit(ItemCatalog itemForEdit, List <string> aboutItemCatalog)
 {
     itemForEdit.Create(aboutItemCatalog);
 }
Exemple #4
0
 public static void Add(ItemCatalog item)
 {
     Catalog.libraryItem.Add(item);
 }