Example #1
0
 public static bool SaveSettings(ClientSettings o)
 {
     bool res = true;
     StreamWriter writer = null;
     try
     {
         XmlSerializer xml = new XmlSerializer(o.GetType());
         writer = new StreamWriter(Application.StartupPath + @"\QClient.config");
         xml.Serialize(writer, o);
     }
     catch (Exception)
     {
         res = false;
     }
     finally
     {
         if (writer != null)
         {
             writer.Close();
         }
     }
     return res;
 }