public static DocumentGenerator Create(ContractDefinition contract = null) { return new DocumentGenerator { ContractDefinition = contract }; }
protected internal override void DoExecute(DocumentGenerator generator, ContractDefinition definition) { ProxyGenerator proxyGenerator = null; if (Mode.HasFlag(GenerateContractMode.Proxy)) { proxyGenerator = new ProxyGenerator { ForceAsync = ForceAsync, ContractDefinition = definition, Namespace = Namespace, Name = Name, Modifier = GetModifier() }; if (!string.IsNullOrEmpty(Generator)) { proxyGenerator.UserGenerator = Parent.GetGenerator(Generator); } if (!string.IsNullOrEmpty(Suffix)) { proxyGenerator.Suffix = Suffix; } } if (Mode.HasFlag(GenerateContractMode.Interface)) { InterfaceGenerator interfaceGenerator = new InterfaceGenerator { ContractDefinition = definition, ForceAsync = ForceAsync, ExcludedInterfaces = ExcludedInterfaces }; generator.Add(interfaceGenerator); interfaceGenerator.Generated += (s, e) => { if (proxyGenerator != null) { proxyGenerator.BaseInterfaces = interfaceGenerator.GeneratedAsyncInterfaces.ToList(); } }; } if (proxyGenerator != null) { generator.Add(proxyGenerator); } }
public MethodDescriptor(ContractDefinition contract, MethodInfo method, string name) { Contract = contract; Method = method; Name = name; }
public MethodDescriptor GetMethodDescriptor(ContractDefinition contract, MethodInfo method) { return new MethodDescriptor(contract, method, method.Name); }
public ContractExecution(ContractDefinition definition) { Definition = definition; }
public DocumentGenerator Proxy(ContractDefinition definition = null, ClassDescriptor descriptor = null, bool forceAsync = false) { return AddContractGenerator(new ProxyGenerator(Output, Formatter, IntendProvider) { ContractDefinition = definition ?? ContractDefinition, ContractDescriptor = descriptor, ForceAsync = forceAsync }); }
public override string GetFileName(ContractDefinition definition) { return $"{definition.Name}.Proxy.Designer.cs"; }
private ContractDefinition CoerceDescriptor(ContractDefinition definition) { return new ContractDefinition(definition.Root, definition.ExcludedContracts.Concat(GetExcludedTypes()).Distinct().ToArray()); }
public abstract string GetFileName(ContractDefinition definition);
protected internal abstract void DoExecute(DocumentGenerator generator, ContractDefinition definition);