RikWare
...

Attributes Can Provide Code

Friday, 30 April 2004 14:41 by admin

OK, the first step of Rikxtensible C# has been done. Ever wanted to print "Hello World" via an attribute? This fragment now compiles, and after running through Rikxtensible C# allows the PrivateImportAttribute to provide the code for TestMethod.

class TestClass
{
[PrivateImport(), MethodImpl(MethodImplOptions.ForwardRef)]
static extern void TestMethod();

[STAThread]
static void Main(string[] args)
{
TestMethod();
}
}

Obviously, this is only a proof of concept at the moment but soon we'll have compile time code injection for C#.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Related posts

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

January 7. 2009 20:28