예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
        /// <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);
        }
예제 #4
0
        /// <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);
        }
예제 #5
0
 /// <summary>
 ///     分析程序集
 /// </summary>
 /// <returns></returns>
 internal SolutionConfig AnalyzeAssemblyFile(string file)
 {
     return(AssemblyImporter.Import(typeof(PropertyConfig).Assembly));
 }
예제 #6
0
 /// <summary>
 ///     分析程序集
 /// </summary>
 /// <returns></returns>
 internal void AnalyzeConfig(ProjectConfig arg)
 {
     AssemblyImporter.Import(arg, typeof(ProjectConfig).Assembly);
 }
예제 #7
0
 /// <summary>
 ///     分析程序集
 /// </summary>
 /// <returns></returns>
 internal ProjectConfig AnalyzeAssemblyFile(string file)
 {
     return(AssemblyImporter.Import(Model.Context.SelectProject, file));
 }