Article View: borland.public.csharpbuilder.language.csharp
Article #411Re: Class reference
From: Marcelo Silva
Date: Tue, 04 Oct 2005 20:12
Date: Tue, 04 Oct 2005 20:12
33 lines
2108 bytes
2108 bytes
Craig Stuntz [TeamB] wrote: > Marcelo Silva wrote: > > >>Does anyone know how can I do something similar to the following in >>C#: >> >>TMyClassClass = class of TMyClass; >>TMyClass = class(TObject) >> >>any help will be appreciated > > > You can't. C# doesn't have metaclasses. What do you actually need to > do? There are usually alternate patterns to get the same things done. > Thanks I figure another way to do what i've got to do... I was looking a sample of state pattern written in Delphi that used to create all of the state at once and change the state using a setState procedure that gets a TMyClassClass as argument... I did some changes and instead of create all objects at once I will be creating it as needed... Let me ask another question: Is there any thing similar to initialization/finalization in c#? thanks again... Marcelo
Technical Details
Message-ID:
<4342e1b4@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!80.239.144.83.MISMATCH!newspeer1.de.telia.net!newspeer4.de.telia.net!de.telia.net!newsfeed.inode.at!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mailReferences:
<434125f6@newsgroups.borland.com> <43413970$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,b5eaefadd83b78e6 X-Google-Attributes: gid1efe35,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Tue, 04 Oct 2005 17:12:33 -0300 From: Marcelo Silva <marcelo@pathcompany.com.br> User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.csharpbuilder.language.csharp Subject: Re: Class reference References: <434125f6@newsgroups.borland.com> <43413970$1@newsgroups.borland.com> In-Reply-To: <43413970$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 0540-0, 04/10/2005), Outbound message X-Antivirus-Status: Clean NNTP-Posting-Host: 200.204.78.47 Message-ID: <4342e1b4@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1128456628 200.204.78.47 (4 Oct 2005 13:10:28 -0700) Lines: 34 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!80.239.144.83.MISMATCH!newspeer1.de.telia.net!newspeer4.de.telia.net!de.telia.net!newsfeed.inode.at!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail