Beispiel #1
0
        /// <summary>
        /// Сохранение данных
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="model">Модель данных</param>
        public static void SaveItems <T>(ObservableCollection <T> model)
        {
            string path = PathModel(model);

            if (path != null)
            {
                FileSerialize.Serialize(model, path);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Загрузка данных
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="model">Модель данных</param>
        /// <returns>Модель данных</returns>
        public static ObservableCollection <T> GetItems <T>(ObservableCollection <T> model)
        {
            string path = PathModel(model);

            if (path != null)
            {
                return(FileSerialize.Deserialize(model, path));
            }
            else
            {
                return(null);
            }
        }