Getting the CodeClass from argument inside CodeAttribute?
问题 I am working on some T4 code generation, for this I need the CodeClass of the type that is passed inside the constructor of BarAttribute. class Baz { } class Bar : Attribute { public Bar (Type type) { } } [Bar(typeof(Baz))] public class Foo { } This is what I have so far inside my T4 Template, I just give the CodeAttribute '[Bar(typeof(Baz))]' to the function: private CodeClass GetType(CodeElement codeElement) { CodeAttribute attribute = (CodeAttribute)codeElement; if (attribute.Name == "Bar"