示例#1
0
        public static void Build(ReadOnlyCollection <Type> targets, ProxyContext context)
        {
            targets.CheckBuildPreconditions();
            context.CheckBuildPreconditions();

            foreach (var target in targets)
            {
                target.CheckBuildPreconditions();
            }

            var nonProxiedTypes = new List <Type>(
                targets.Where(target =>
            {
                return(!BuiltProxies.Mappings.ContainsKey(target));
            })
                );

            if (nonProxiedTypes.Count > 0)
            {
                var items = ProxyBuilder.Generate(targets[0], context);

                foreach (var target in targets)
                {
                    ProxyBuilder.Build(target, items);
                }

                ProxyBuilder.Save(items.Assembly, context);
            }
        }
示例#2
0
        public static void Build(Type target, ProxyContext context)
        {
            target.CheckBuildPreconditions();
            context.CheckBuildPreconditions();
            var items = ProxyBuilder.Generate(target, context);

            ProxyBuilder.Build(target, items);
            ProxyBuilder.Save(items.Assembly, context);
        }
示例#3
0
 public static void Build(ReadOnlyCollection <Type> targets)
 {
     ProxyBuilder.Build(targets, new ProxyContext());
 }