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

Location to implement ICloneable

Mar 24, 2015 at 1: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 1:10 PM
Edited Mar 24, 2015 at 7: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 1:16 AM
No problems. I've made an extension method instead.