// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <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); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <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); }