コード例 #1
0
 public static void Attach(
     IMethodSymbol constructor,
     string typeName,
     IList<SyntaxNode> statements,
     IList<SyntaxNode> baseConstructorArguments,
     IList<SyntaxNode> thisConstructorArguments)
 {
     var info = new CodeGenerationConstructorInfo(typeName, statements, baseConstructorArguments, thisConstructorArguments);
     s_constructorToInfoMap.Add(constructor, info);
 }
コード例 #2
0
 private static string GetTypeName(CodeGenerationConstructorInfo info, IMethodSymbol constructor)
 {
     return info == null ? constructor.ContainingType.Name : info._typeName;
 }
コード例 #3
0
 private static IList<SyntaxNode> GetStatements(CodeGenerationConstructorInfo info)
 {
     return info == null ? null : info._statements;
 }
コード例 #4
0
 private static IList<SyntaxNode> GetBaseConstructorArgumentsOpt(CodeGenerationConstructorInfo info)
 {
     return info == null ? null : info._baseConstructorArguments;
 }
コード例 #5
0
 private static IList <SyntaxNode> GetThisConstructorArgumentsOpt(CodeGenerationConstructorInfo info)
 {
     return(info == null ? null : info._thisConstructorArguments);
 }
コード例 #6
0
 private static string GetTypeName(CodeGenerationConstructorInfo info, IMethodSymbol constructor)
 => info == null ? constructor.ContainingType.Name : info._typeName;
コード例 #7
0
 private static ImmutableArray <SyntaxNode> GetStatements(CodeGenerationConstructorInfo info)
 => info?._statements ?? default;
コード例 #8
0
 private static ImmutableArray <SyntaxNode> GetBaseConstructorArgumentsOpt(CodeGenerationConstructorInfo info)
 => info?._baseConstructorArguments ?? default;
コード例 #9
0
 private static IList <SyntaxNode> GetStatements(CodeGenerationConstructorInfo info)
 {
     return(info == null ? null : info.statements);
 }
コード例 #10
0
 private static bool GetIsUnsafe(CodeGenerationConstructorInfo info)
 => info?._isUnsafe ?? false;