Пример #1
0
        private void LoadRegistry()
        {
            var filepath = GetFilePath();

            _registry = new DefinitionRegistry();

            if (File.Exists(filepath))
            {
                XmlSerializer   ser = new XmlSerializer(typeof(DefinitionsRoot));
                DefinitionsRoot root;
                using (var fs = File.OpenRead(filepath))
                    root = (DefinitionsRoot)ser.Deserialize(fs);

                root.Definitions.ForEach(def => _registry.AddDefinition(def));
                root.Relations.ForEach(rel => _registry.AddRelation(rel));
            }
        }
        private void LoadRegistry()
        {
            var filepath = GetFilePath();
            _registry = new DefinitionRegistry();

            if (File.Exists(filepath))
            {
                XmlSerializer ser = new XmlSerializer(typeof(DefinitionsRoot));
                DefinitionsRoot root;
                using (var fs = File.OpenRead(filepath))
                    root = (DefinitionsRoot)ser.Deserialize(fs);

                root.Definitions.ForEach(def => _registry.AddDefinition(def));
                root.Relations.ForEach(rel => _registry.AddRelation(rel));
            }
        }