Mono.CSharp.ImportedModuleDefinition.ReadAssemblyAttributes C# (CSharp) Method

ReadAssemblyAttributes() public method

public ReadAssemblyAttributes ( ) : List
return List
        public List<Attribute> ReadAssemblyAttributes()
        {
            var t = module.GetType (AssemblyAttributesPlaceholder.GetGeneratedName (Name));
            if (t == null)
                return null;

            var field = t.GetField (AssemblyAttributesPlaceholder.AssemblyFieldName, BindingFlags.NonPublic | BindingFlags.Static);
            if (field == null)
                return null;

            // TODO: implement, the idea is to fabricate specil Attribute class and
            // add it to OptAttributes before resolving the source code attributes
            // Need to build module location as well for correct error reporting

            //var assembly_attributes = CustomAttributeData.GetCustomAttributes (field);
            //var attrs = new List<Attribute> (assembly_attributes.Count);
            //foreach (var a in assembly_attributes)
            //{
            //    var type = metaImporter.ImportType (a.Constructor.DeclaringType);
            //    var ctor = metaImporter.CreateMethod (a.Constructor, type);

            //    foreach (var carg in a.ConstructorArguments) {
            //        carg.Value
            //    }

            //    attrs.Add (new Attribute ("assembly", ctor, null, Location.Null, true));
            //}

            return null;
        }