Пример #1
0
        public static INode Create(string filePath, IEnumerable <Type> typesToMatch)
        {
            var module = ModuleImportUtilities.GetModule(filePath);

            if (module == null || !NodeTypes.ContainsKey(module.ModelType))
            {
                throw new InvalidDataException("File type could not be determined.");
            }

            ConfigurationList.Instance.DetermineCurrentConfiguration(filePath);
            return(Create(module.ModelType, Path.GetFileName(filePath), module.Import(filePath)));
        }
Пример #2
0
        public static INode Create(string filePath, IEnumerable <Type> typesToMatch)
        {
            var module = ModuleImportUtilities.GetModule(filePath);

            if (module == null || !NodeTypes.ContainsKey(module.ModelType))
            {
                return(new StreamNode(Path.GetFileName(filePath), File.OpenRead(filePath)));
            }

            ConfigurationList.Instance.DetermineCurrentConfiguration(filePath);
            return(Create(module.ModelType, Path.GetFileName(filePath), module.Import(filePath)));
        }