Ejemplo n.º 1
0
        protected static void SaveSettings(string path, IDictionary <string, string> settings)
        {
            FileUtilities.CreateDirectoryForFile(path);

            var container = new SavedSettingsContainer()
            {
                Settings = settings.Select(p => new SavedSetting()
                {
                    Key   = p.Key,
                    Value = p.Value
                }).ToArray()
            };

            var serializer = new XmlSerializer(typeof(SavedSettingsContainer));

            using (var file = File.Open(path, FileMode.Create))
            {
                serializer.Serialize(file, container);
            }
        }
        protected static void SaveSettings(string path, IDictionary<string, string> settings)
        {
            FileUtilities.CreateDirectoryForFile(path);

            var container = new SavedSettingsContainer()
            {
                Settings = settings.Select(p => new SavedSetting()
                {
                    Key = p.Key,
                    Value = p.Value
                }).ToArray()
            };

            var serializer = new XmlSerializer(typeof(SavedSettingsContainer));

            using (var file = File.Open(path, FileMode.Create))
            {
                serializer.Serialize(file, container);
            }
        }