public static Options Import(string filename)
        {
            Options options = null;

            try
            {
                if (File.Exists(filename))
                {
                    using (FileStream fin = File.OpenRead(filename))
                    {
                        var serializer = new OptionsSerializer();
                        options = serializer.Deserialize(fin);
                        var currentProvider = GetCurrentOptionsProvider();
                        if (!currentProvider.IsReadOnly)
                        {
                            currentProvider.Save(options);
                        }
                    }
                }
            }
            catch
            {
                options = new Options();
            }
            return(options);
        }
 public static void Export(Options options, string filename)
 {
     using (FileStream fout = File.Create(filename))
     {
         OptionsSerializer serializer = new OptionsSerializer();
         serializer.Serialize(fout, options);
     }
 }