I'm translating some Java code to C#. The Java code looks something like
public abstract class myClass implements Cloneable, Serializable {
//fields, constructors etc here.
//...
//...
public abstract Object clone(); //an implementation of this is eventually provided
in a subclass
//...
//...
}
The clone() from the Cloneable interface was implemented and Serializable has no methods so nothing needs to be implemented from there.
In C# my class looks something like this:
public class myClass : ISerializable, ICloneable{
//fields, constructors etc here.
//...
//...
public abstract Object Clone ();
//...
//...
}
As you can see, ICloneable's method was implemented, but in C#, unlike Java's Serializable, ISerializable interface DOES have a method, so I need to implement it. The problem is I am not sure how, since I am translating this code from Java, and this doesn't need to be done there.
Can someone please let me know how to do this in C#?
I know the missing method is GetObjectData, but I have no idea how to implement it, what to pass to it, or what should be inside it, since this is completely missing in the Java equivalent...