public bool Save() { lock (this) { try { if (m_path == null) { CLog.e("Can't save settings: path is null"); return(false); } using (Stream stream = CFileUtils.OpenWrite(m_path)) { CPlist.writeBinary(m_data, stream); return(true); } } catch (Exception e) { CLog.error(e, "Can't save settings: {0}", m_path); return(false); } } }
////////////////////////////////////////////////////////////////////////////// public bool Load() { lock (this) { try { if (m_path == null) { CLog.e("Can't load settings: path is null"); return(false); } if (CFileUtils.FileExists(m_path)) { m_data = CPlist.readPlist(m_path) as Dictionary <string, object>; return(true); } } catch (Exception e) { CLog.error(e, "Can't read settings: {0}", m_path); } m_data = new Dictionary <string, object>(); return(false); } }