M
mehdi_mousavi
Hi,
Consider two classes from different namespaces each of which is derived
from a given class in the third namespace:
1. MyNamespace1.FirstClass : ThirdNamespace.MyBaseClass
2. MyNamespace2.SecondClass : ThirdNamespace.MyBaseClass
and consider the following code snippet:
MyNamespace1.FirstClass c1;
MyNamespace2.SecondClass c2;
Why the following assignment doesn't simply work?
c1 = (ThirdNamespace.MyBaseClass)c2;
How am I supposed to do the above mentioned assignment?
Any help would be highly appreciated,
TIA,
Mehdi
Consider two classes from different namespaces each of which is derived
from a given class in the third namespace:
1. MyNamespace1.FirstClass : ThirdNamespace.MyBaseClass
2. MyNamespace2.SecondClass : ThirdNamespace.MyBaseClass
and consider the following code snippet:
MyNamespace1.FirstClass c1;
MyNamespace2.SecondClass c2;
Why the following assignment doesn't simply work?
c1 = (ThirdNamespace.MyBaseClass)c2;
How am I supposed to do the above mentioned assignment?
Any help would be highly appreciated,
TIA,
Mehdi