Exemplo n.º 1
0
        private void SaveRegistry()
        {
            XmlSerializer ser  = new XmlSerializer(typeof(DefinitionsRoot));
            var           root = new DefinitionsRoot()
            {
                Definitions = _registry.GetAllDefinitions().ToList(),
                Relations   = _registry.GetAllRelations().ToList()
            };

            var filepath = GetFilePath();

            using (var fs = File.Open(filepath, File.Exists(filepath) ? FileMode.Truncate : FileMode.Create, FileAccess.Write))
                ser.Serialize(fs, root);
        }
        private void SaveRegistry()
        {
            XmlSerializer ser = new XmlSerializer(typeof(DefinitionsRoot));
            var root = new DefinitionsRoot()
            {
                Definitions = _registry.GetAllDefinitions().ToList(),
                Relations = _registry.GetAllRelations().ToList()
            };

            var filepath = GetFilePath();
            using (var fs = File.Open(filepath, File.Exists(filepath) ? FileMode.Truncate : FileMode.Create, FileAccess.Write))
                ser.Serialize(fs, root);
        }