protected override void RunCore() { if (LoadConfiguration()) { List<Exception> exs = new List<Exception>(); try { foreach (ContractServiceDefinition item in _Configuration.ContractServiceInterfaces) { item.IsPartial = true; InterfaceTemplate template = new InterfaceTemplate(); template.Interface = (ContractServiceInterfaceDefinition)item; template.Output.File = String.Format(@"{0}.cs", item.Name); template.Render(); } } catch (Exception ex) { exs.Add(ex); } if (exs.Count > 0) { ErrorTemplate errortemplate = new ErrorTemplate(); ErrorTemplate.Exceptions = exs; errortemplate.Output.File = "Error.log"; errortemplate.Render(); throw new Exception("See generated output for errors."); } } }
public virtual string GenerateCode() { InterfaceTemplate t = new InterfaceTemplate(); t.Interface = this; return t.TransformText(); }