Exemplo n.º 1
0
            > GetAnonymousTypeMap()
        {
            var result =
                new Dictionary <
                    Microsoft.CodeAnalysis.Emit.AnonymousTypeKey,
                    Microsoft.CodeAnalysis.Emit.AnonymousTypeValue
                    >();
            var templates = ArrayBuilder <AnonymousTypeTemplateSymbol> .GetInstance();

            // Get anonymous types but not synthesized delegates. (Delegate types are
            // not reused across generations since reuse would add complexity (such
            // as parsing delegate type names from metadata) without a clear benefit.)
            GetCreatedAnonymousTypeTemplates(templates);
            foreach (var template in templates)
            {
                var nameAndIndex = template.NameAndIndex;
                var key          = template.GetAnonymousTypeKey();
                var value        = new Microsoft.CodeAnalysis.Emit.AnonymousTypeValue(
                    nameAndIndex.Name,
                    nameAndIndex.Index,
                    template.GetCciAdapter()
                    );
                result.Add(key, value);
            }
            templates.Free();
            return(result);
        }
Exemplo n.º 2
0
 internal IReadOnlyDictionary<Microsoft.CodeAnalysis.Emit.AnonymousTypeKey, Microsoft.CodeAnalysis.Emit.AnonymousTypeValue> GetAnonymousTypeMap()
 {
     var result = new Dictionary<Microsoft.CodeAnalysis.Emit.AnonymousTypeKey, Microsoft.CodeAnalysis.Emit.AnonymousTypeValue>();
     var templates = GetAllCreatedTemplates();
     foreach (AnonymousTypeTemplateSymbol template in templates)
     {
         var nameAndIndex = template.NameAndIndex;
         var key = template.GetAnonymousTypeKey();
         var value = new Microsoft.CodeAnalysis.Emit.AnonymousTypeValue(nameAndIndex.Name, nameAndIndex.Index, template);
         result.Add(key, value);
     }
     return result;
 }