public static StringBuilder GenerateCSharpProxyCode(string defaultBaseAddress, string[] classNames, string nameSpace, string contractNamespace, Incubator incubator, ILogger logger = null, bool includeLocalMethods = false)
        {
            logger = logger ?? Log.Default;
            List <Type> types = new List <Type>();

            classNames.Each(new { Logger = logger, Types = types }, (ctx, cn) =>
            {
                Type type = incubator[cn];
                if (type == null)
                {
                    ctx.Logger.AddEntry("Specified class name was not registered: {0}", LogEventType.Warning, cn);
                }
                else
                {
                    ctx.Types.Add(type);
                }
            });
            Args.ThrowIf(types.Count == 0, "None of the specified classes were found: {0}", string.Join(", ", classNames));
            return(ServiceProxySystem.GenerateCSharpProxyCode(defaultBaseAddress, nameSpace, contractNamespace, types.ToArray(), includeLocalMethods));
        }
Beispiel #2
0
 private StringBuilder GenerateCSharpProxyCode(string defaultBaseAddress)
 {
     return(ServiceProxySystem.GenerateCSharpProxyCode(defaultBaseAddress, ClassNames, Namespace, ContractNamespace));
 }