public void Assign(IClone src)
{
//1. make sure that src is pointing to a valid object
if (null == src)
{
throw new COMException("Invalid objact.");
}
//2. make sure that the type of src is of type 'ClonableObjClass'
if (!(src is ClonableObjClass))
{
throw new COMException("Bad object type.");
}
//3. assign the properties of src to the current instance
ClonableObjClass srcClonable = (ClonableObjClass)src;
m_name = srcClonable.Name;
m_version = srcClonable.Version;
m_ID = new Guid(srcClonable.ID.ToString());
//don't clone the spatial reference, since in this case we want both object to
//reference the same spatial reference (for example like features in a featureclass
//which share the same spatial reference)
m_spatialRef = srcClonable.SpatialReference;
//clone the point. Use deep cloning
if (null == srcClonable.Point)
m_point = null;
else
{
IObjectCopy objectCopy = new ObjectCopyClass();
object obj = objectCopy.Copy((object)srcClonable.Point);
m_point = (IPoint)obj;
}
m_arr = (ArrayList)srcClonable.ManagedArray.Clone();
}