Re: Casting of derived classes

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Georg Fleischer" <GeorgFleischer@xxxxxxxxxxxxxxxxxxxxxxxxx> a écrit dans le
message de news: 6CB564BF-7A50-4BC7-9CAE-325E89CCD22C@xxxxxxxxxxxxxxxx

> This newsgroup-post describes exactly what I want to do, but doesn't help
> me, because in my case the described base class "vehicle" is "UserControl"
in
> "System.Web.UI" Namespace. I have no chance of implementing a copy
contructor
> to the UserControl class.
>
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.dotnet
..languages.csharp&mid=0cc2e888-5066-425b-a172-5399ef07740c
>
> That leeds me to the point of despartion. If anybody has an idea, how to
> solve this problem, please write.

I asked you why you wanted to access private members of UserControl in your
copying routine. What is your answer ?

As was mentioned in the MSDN thread, what you are trying to do is based on
unsound design and until you can justify what you are trying to achieve in
more detail, it is very difficult for anyone to give you an answer that
makes any sense.

The idea of using ICloneable in a derived class also means that you would
have to write a list of assignments of protected or public properties; that
is what cloning is all about, you don't have a choice.

Joanna

--
Joanna Carter
Consultant Software Engineer


.