Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reflection

1 view
Skip to first unread message

Net

unread,
Oct 15, 2006, 6:09:15 PM10/15/06
to
Hi, I'm in the process of learning c#, but i'm getting the hang of it pretty
fast. The problem is documentation. I've read up on C# reflection, and i'm
already using it, but there are certain things which aren't stated. For
instance, my issue is that of class references. How do you do such in C#.
Like for instance, delphi:

{* class reference declaration *}
TDBObjectClass = class of TDBObject;

{*
Method returns the remotable object for a given
class type...the method here is a class funciton
*}
TDBObject.GetRemotableClass(aClass: TDBObjectClass):TRemotable;
begin
.....
end;


My issue is how do i declare TDBObjectClass in C#?


Joanna Carter [TeamB]

unread,
Oct 15, 2006, 6:28:15 PM10/15/06
to
"Net" <netmas...@gmail.com> a écrit dans le message de news:
4532b184$1...@newsgroups.borland.com...

Unless you write your own metaclasses, C# does not support class references
per se. So the answer is, you can't declare class references without writing
metaclasses yourself.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer


Marc Rohloff [TeamB]

unread,
Oct 16, 2006, 7:45:02 AM10/16/06
to
On Sun, 15 Oct 2006 18:09:15 -0400, Net wrote:

> TDBObject.GetRemotableClass(aClass: TDBObjectClass):TRemotable;

> My issue is how do i declare TDBObjectClass in C#?

The nearest thing available is to use the System.Type class and create
instances using reflection (Activator.CreateInstance)

--
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com

Francois PIETTE [ICS - MidWare]

unread,
Oct 17, 2006, 12:37:08 PM10/17/06
to
If you contact me by email, I have some C# source code to share. This code
show how to handle metaclass with C#.

--
francoi...@overbyte.be
The author for the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


"Net" <netmas...@gmail.com> a écrit dans le message de news:
4532b184$1...@newsgroups.borland.com...

0 new messages