Пример #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);
            }
        }
Пример #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);
            }
        }