I suspect it's unlikely, but you'll never know until you ask, but are there any attributes that would allow us to contribute to
the compiled output?
e.g.
// this class exists in a separate, compiled assembly for the compiler to load during compilation
class MyMethodCompiler : Attribute
{
// This is called during compilation
public override void GenerateMethod(MethodBuilder method)
{
// modify the IL that was generated from the compiler
}
}
// some class in a user assembly
class MyClass
{
[MyMethodCompiler]
public void SomeMethod(...)
{
// User code in method
...
...
...
}
}
cody - 05 May 2006 12:31 GMT
There is no such thing. use #if..#endif for conditional compiling or use
CSharpCodeProvider or CodeDom for generating your own code.
>I suspect it's unlikely, but you'll never know until you ask, but are there
>any attributes that would allow us to contribute to the compiled output?
[quoted text clipped - 25 lines]
> }
> }
Nicole Calinoiu - 05 May 2006 13:20 GMT
If you're using C#, you might want to take a look at XC#
(http://www.resolvecorp.com). It's a post-compiler that allows, amongst
other things, use of custom attributes to specify code generation during
compile-time processing.
>I suspect it's unlikely, but you'll never know until you ask, but are there
>any attributes that would allow us to contribute to the compiled output?
[quoted text clipped - 25 lines]
> }
> }