コード例 #1
0
        public static void Save(string fileName, FestManagerSettings settings)
        {
            var serializer = new XmlSerializer(typeof(FestManagerSettings));

            using (var writer = new StreamWriter(fileName))
            {
                serializer.Serialize(writer, settings);
            }
        }
コード例 #2
0
        public static FestManagerSettings Load(string fileName)
        {
            FestManagerSettings result = null;
            var serializer             = new XmlSerializer(typeof(FestManagerSettings));

            using (var reader = new StreamReader(fileName))
            {
                result = (FestManagerSettings)serializer.Deserialize(reader);
            }

            return(result);
        }