/// <summary> /// 分析文件程序集 /// </summary> /// <param name="assembly"></param> public static SolutionConfig Import(Assembly assembly) { var importer = new AssemblyImporter { _assembly = assembly, _project = new SolutionConfig { Entities = new ObservableCollection <EntityConfig>() } }; importer.ReadEntities(); return(importer._project); }
/// <summary> /// 打开并分析文件 /// </summary> /// <param name="file"></param> public static SolutionConfig Import(string file) { var importer = new AssemblyImporter { _assembly = Assembly.LoadFile(file), _project = new SolutionConfig { Entities = new ObservableCollection <EntityConfig>() } }; importer.ReadEntities(); return(importer._project); }
/// <summary> /// 打开并分析文件 /// </summary> /// <param name="project"></param> /// <param name="file"></param> public static ProjectConfig Import(ProjectConfig project, string file) { var importer = new AssemblyImporter(project, file); try { importer._assembly = importer.LoadReflection(file); importer.ReadTypes(); importer.ReadEntities(); } catch (Exception ex) { Trace.WriteLine(ex); } return(importer._project); }
/// <summary> /// 打开并分析文件 /// </summary> /// <param name="project"></param> /// <param name="assembly"></param> public static ProjectConfig Import(ProjectConfig project, Assembly assembly) { var importer = new AssemblyImporter(project, assembly.Location) { IncludeBaseType = false }; try { importer._assembly = assembly; importer.ReadTypes(); importer.ReadEntities(); } catch (Exception ex) { Trace.WriteLine(ex); } return(importer._project); }
/// <summary> /// 分析程序集 /// </summary> /// <returns></returns> internal SolutionConfig AnalyzeAssemblyFile(string file) { return(AssemblyImporter.Import(typeof(PropertyConfig).Assembly)); }
/// <summary> /// 分析程序集 /// </summary> /// <returns></returns> internal void AnalyzeConfig(ProjectConfig arg) { AssemblyImporter.Import(arg, typeof(ProjectConfig).Assembly); }
/// <summary> /// 分析程序集 /// </summary> /// <returns></returns> internal ProjectConfig AnalyzeAssemblyFile(string file) { return(AssemblyImporter.Import(Model.Context.SelectProject, file)); }