Class Augmentation
Tuesday 20 August 2002
I'm working on a project in which the use of nested classes within a single parent class makes for a very large source file. I'd like to be able to spread the parent class across several source files, one for each of the nested classes. Unfortunately C# does not support class augmentation (as this capability is called in chapter six of Inside Microsoft .NET IL Assembler). Once a class declaration in C# has been closed it cannot be re-opened. For example the following is not allowed:
class A
{
public void Foo() { }
}
class A
{
public void Bar() { }
}
Class augmentation is supported by ILAsm and would look something like this:
.class A
{
.method public void Foo()
{
ret
}
}
// following possibly in another source file
.class A
{
.method public void Bar()
{
ret
}
}
Posted by
at 08:49 PM.
Permalink.
Copyright © Charles Cook.
Valid XHTML 1.0