Ejemplo n.º 1
0
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        /// <summary>
        /// reads an file
        /// </summary>
        /// <param name="fn">fileName</param>
        /// <returns>bool</returns>
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        public bool LoadFile(string fn)
        {
            bool rt = false;

            // get the reader writer object
            RssFileReaderWriter rw = new RssFileReaderWriter();

            // load the file from disk
            string xml = rw.Read(fn);

            if (!string.IsNullOrEmpty(xml))
            {
                rt = Load(xml);
            }
            return(rt);
        }
Ejemplo n.º 2
0
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        /// <summary>
        /// Saves a file
        /// </summary>
        /// <param name="fn">file name</param>
        /// <returns>bool</returns>
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        public bool SaveFile(string fn)
        {
            bool rt = false;

            RssFileReaderWriter rw = new RssFileReaderWriter();

            try
            {
                // get the xml
                string xml = GetXml();

                // write the file
                bool rt1 = rw.Save(xml, fn);

                // assign (ie try and let save complete
                rt = rt1;
            }
            catch (Exception) { }
            return(rt);
        }