This project has moved and is read-only. For the latest updates, please go here.

Location to implement ICloneable

Mar 24, 2015 at 2:00 PM

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 :)

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:

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.