Beispiel #1
0
        /// <summary>
        /// Deserialize data from an xmlfile saved from the application
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public bool XMLDeserialization(string fileName)
        {
            bool sucess = false;

            if (!string.IsNullOrEmpty(fileName))
            {
                adaptableList = XMLSerializerUtility.XMlFileDeserializer <List <T> >(fileName);
            }
            return(sucess);
        }
Beispiel #2
0
        /// <summary>
        /// Serialize a list of data into an xmlfile
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public bool XMlSerialization(string fileName)
        {
            bool sucess = false;

            if (!string.IsNullOrEmpty(fileName)) // does the file have proper naming?
            {
                sucess = true;                   // if so sucess is true
            }
            if (sucess)
            {
                XMLSerializerUtility.XMLSerialize <T>(fileName, adaptableList);// call xmlserializermethod from utility classes
            }
            return(sucess);
        }