I'm trying to call some code written in Delphi for .Net. In Delphi,
every class has a corresponding metaclass type; you can use a
metaclass reference to create instances of the class &c. What's
important here is that some methods take a metaclass reference as a
parameter.
On .Net, metaclasses are implemented as compiler created nested
classes - something like
public class Foo
{
public class @MetaFoo
{
public static @MetaFoo @Instance;
}
public static void Bar(@MetaFoo MetaRef) {}
}
Now, VS's Object Browser can see @MetaFoo and @MetaFoo.@MetaInstance.
Intellisense even sees @MetaFoo when I type
Foo.Bar(Foo.
BUT! Intellisense does NOT see @Instance when I type
Foo.Bar(Foo.@MetaFoo.
AND when I try to compile
Foo.Bar(Foo.@MetaFoo.@Instance);
I get a message that Foo "does not contain a definition for
'MetaFoo'". I know that @Identifier is an escape to allow use of
keywords as identifiers, but how do I (can I?) tell C# that I really
truly mean @MetaFoo and @Instance, not MetaFoo and Instance?
(@@MetaFoo.@@Instance does not work.)
--
programmer, author http://www.midnightbeach.com
and father http://www.midnightbeach.com/hs