dalewolver wrote:
> Am learning C# and would like to know if someone familiar with it 
> might answer simple, I hope, question

I suggest you peruse the help file. Delphi 2005 comes with the full .Net 
Framework SDK help file, which has the complete reference manual for the 
C# language.

> In delphi I can contain a class within another class
> eg
> 
> TDoor = class
>  ....
> end;
> 
> TCar = class
> ...
>    property Door : TDoor read FDoor write FDoor;
> end
> 
> How does one do something like that in C#

Your question doesn't match your code.

In both Delphi 2005 and C#, you can contain a class within another class:

type
   TCar = class
   public
     type
       TDoor = class
       public
         constructor Create;
       end;
   end;

constructor TCar.TDoor.Create;
begin
end;

public class TCar {
   public class TDoor {
     public TDoor() {
     }
   }
}

Your code demonstrated a class that has a property. The one class does 
not "contain" the other class. C# can do properties.

public class TCar {
   public TDoor Door {
     get {
       return FDoor;
     }
     set {
       FDoor = value;
     }
   }
}

-- 
Rob


-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to