G
Guest
Hi
I make a class "MyClass" and this clas implements the Interface ICloneable.
I want when I instance an object from MyClass and I call obj.Clone() it
returns an object of MyClass type.
for example:
public class MyClasss : ICloneable
{
public void A();
public object Clone(){} // The ICloneable Method
}
when I do this:
MyClass obj;
obj.Clone() I want also call the method A. but Clone returns an object, not
a MyClass object. If I defines the Clone method like this: public MyClass
Clone{} I receive an error, It is logic. but all .NET classes that implements
the interface ICloneable, the method Clone returns an object of the same type
of the class that implement this interface.
how can I do this!
thanks
I make a class "MyClass" and this clas implements the Interface ICloneable.
I want when I instance an object from MyClass and I call obj.Clone() it
returns an object of MyClass type.
for example:
public class MyClasss : ICloneable
{
public void A();
public object Clone(){} // The ICloneable Method
}
when I do this:
MyClass obj;
obj.Clone() I want also call the method A. but Clone returns an object, not
a MyClass object. If I defines the Clone method like this: public MyClass
Clone{} I receive an error, It is logic. but all .NET classes that implements
the interface ICloneable, the method Clone returns an object of the same type
of the class that implement this interface.
how can I do this!
thanks