This project has moved. For the latest updates, please go here.

Location to implement ICloneable

Mar 24, 2015 at 2:00 PM
Hi,

Any chance to get Location to implement ICloneable? I'm passing Location objects to multiple recipients that need to retain their own copies. I'm lazy... I only like to type new if I have to :)

-Richard.
Coordinator
Mar 24, 2015 at 2:10 PM
Edited Mar 24, 2015 at 8:35 PM
From the ICloneable Interface MSDN page:
Notes to Implementers
... Because callers of Clone cannot depend on the method performing a predictable cloning operation, we recommend that ICloneable not be implemented in public APIs.
See also this: http://stackoverflow.com/a/3712564/1136211.

So even if the deep or shallow copy problem doesn't occur here, I wouldn't like to implement that interface.
Mar 25, 2015 at 2:16 AM
No problems. I've made an extension method instead.

-Richard.