public static GetObserverAsyncInterfaceName ( |
||
type | ||
return | string |
private void GenerateAsyncCode( Type type, CodeWriter.CodeWriter w, Type[] baseTypes, Tuple <Type, List <Tuple <MethodInfo, string> > >[] typeInfos) { // NoReply Interface var baseSynces = baseTypes.Select(t => Utility.GetObserverAsyncInterfaceName(t)); var baseSyncesInherit = baseSynces.Any() ? string.Join(", ", baseSynces) : "IInterfacedObserverSync"; w._($"[AlternativeInterface(typeof({type.GetSymbolDisplay(typeless: true)}))]"); using (w.B($"public interface {Utility.GetObserverAsyncInterfaceName(type)}{type.GetGenericParameters()} : {baseSyncesInherit}{type.GetGenericConstraintClause()}")) { foreach (var m in typeInfos.First().Item2) { var method = m.Item1; var parameters = method.GetParameters(); var paramStr = string.Join(", ", parameters.Select(p => p.GetParameterDeclaration(true))); w._($"Task {method.Name}{method.GetGenericParameters()}({paramStr}){method.GetGenericConstraintClause()};"); } } }