Esempio n. 1
0
        /// <summary>
        /// 执行任务
        /// </summary>
        /// <returns></returns>
        public override bool Execute()
        {
            var logger = new Logger(this.Log);

            if (File.Exists(this.TargetAssembly) == false)
            {
                logger.Message($"找不到文件编译输出的程序集{this.TargetAssembly}");
                return(true);
            }

            try
            {
                logger.Message(this.GetType().AssemblyQualifiedName);
                var searchDirectories = this.GetSearchDirectories().Distinct().ToArray();
                using (var assembly = new CeAssembly(this.TargetAssembly, searchDirectories, logger))
                {
                    assembly.WirteProxyTypes();
                }
                return(true);
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
                return(false);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 执行任务
        /// </summary>
        /// <returns></returns>
        public override bool Execute()
        {
            try
            {
                var searchDirectories = this.GetSearchDirectories().Distinct().ToArray();
                void logger(string message) => this.Log.LogMessage(MessageImportance.High, message);

                logger(this.GetType().AssemblyQualifiedName);
                using (var assembly = new CeAssembly(this.TargetAssembly, searchDirectories, logger))
                {
                    assembly.WirteProxyTypes();
                }
                return(true);
            }
            catch (Exception ex)
            {
                this.Log.LogError(ex.Message);
                return(false);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// 代理类型生成器
 /// </summary>
 /// <param name="assembly">程序集</param>
 /// <param name="interface">接口</param>
 public CeProxyType(CeAssembly assembly, CeInterface @interface)
     : base(assembly)
 {
     this.@interface = @interface;
 }
Esempio n. 4
0
 /// <summary>
 /// cecil元数据抽象
 /// </summary>
 /// <param name="module">所在程序集</param>
 public CeMetadata(CeAssembly assembly)
 {
     this.module     = assembly.MainMdule;
     this.knowTypes  = assembly.KnowTypes;
     this.TypeSystem = this.module.TypeSystem;
 }
Esempio n. 5
0
 /// <summary>
 /// 表示接口
 /// </summary>
 /// <param name="assembly">程序集</param>
 /// <param name="interface">接口类型</param>
 public CeInterface(CeAssembly assembly, TypeDefinition @interface)
     : base(assembly)
 {
     this.Type = @interface;
 }