/// <summary>
        /// Creates a destructor symbol that can be used to describe a destructor declaration.
        /// </summary>
        public static IMethodSymbol CreateDestructorSymbol(IList <AttributeData> attributes, string typeName, IList <SyntaxNode> statements = null)
        {
            var result = new CodeGenerationDestructorSymbol(null, attributes);

            CodeGenerationDestructorInfo.Attach(result, typeName, statements);
            return(result);
        }
 public static void Attach(
     IMethodSymbol destructor,
     string typeName,
     IList<SyntaxNode> statements)
 {
     var info = new CodeGenerationDestructorInfo(typeName, statements);
     s_destructorToInfoMap.Add(destructor, info);
 }
Ejemplo n.º 3
0
        public static void Attach(
            IMethodSymbol destructor,
            string typeName,
            ImmutableArray <SyntaxNode> statements)
        {
            var info = new CodeGenerationDestructorInfo(typeName, statements);

            s_destructorToInfoMap.Add(destructor, info);
        }
        /// <summary>
        /// Creates a destructor symbol that can be used to describe a destructor declaration.
        /// </summary>
        public static IMethodSymbol CreateDestructorSymbol(
            ImmutableArray <AttributeData> attributes, string typeName,
            ImmutableArray <SyntaxNode> statements = default(ImmutableArray <SyntaxNode>))
        {
            var result = new CodeGenerationDestructorSymbol(null, attributes);

            CodeGenerationDestructorInfo.Attach(result, typeName, statements);
            return(result);
        }
        protected override CodeGenerationSymbol Clone()
        {
            var result = new CodeGenerationDestructorSymbol(this.ContainingType, this.GetAttributes());

            CodeGenerationDestructorInfo.Attach(result,
                                                CodeGenerationDestructorInfo.GetTypeName(this),
                                                CodeGenerationDestructorInfo.GetStatements(this));

            return(result);
        }
Ejemplo n.º 6
0
 private static string GetTypeName(CodeGenerationDestructorInfo info, IMethodSymbol constructor)
 => info == null ? constructor.ContainingType.Name : info._typeName;
Ejemplo n.º 7
0
 private static ImmutableArray <SyntaxNode> GetStatements(CodeGenerationDestructorInfo info)
 => info?._statements ?? default;
 private static string GetTypeName(CodeGenerationDestructorInfo info, IMethodSymbol constructor)
 {
     return info == null ? constructor.ContainingType.Name : info._typeName;
 }
 private static IList<SyntaxNode> GetStatements(CodeGenerationDestructorInfo info)
 {
     return info == null ? null : info._statements;
 }
Ejemplo n.º 10
0
 private static IList <SyntaxNode> GetStatements(CodeGenerationDestructorInfo info)
 {
     return(info == null ? null : info._statements);
 }