rcd/fo-dicom — pull request #23 by cureos (2012-11-08 08:07:26+00:00)
Title: From  [Serializable] to [DataContract]

Hi Colby,

please find this pull request for replacing dependency on the `[Serializable]` attribute with `[DataContract]`. I have added a unit test project to verify that serialization is still functional. The only two commits that *you* would need to pull into the main fork are [8261732](https://github.com/cureos/fo-dicom/commit/826173224ada74c9cf6993d880c20f790a50a7fa) and [debd69a](https://github.com/cureos/fo-dicom/commit/debd69a38893b1aa1c529183d700221c409554aa), but unfortunately I could not find a way to filter out the other commits from the pull request.

The transfer to `[DataContract]` means that you still can do serialization with any method except `BinaryFormatter`.

With the `DataContractSerializer`, it was not required to decorate `Point2` for serialization at all (because it only contains primitive properties, I assume).
To make serialization of `DicomTag` work completely, I additionally had to decorate the `DicomPrivateCreator` class with the `[DataContract]` attribute as well.
Finally, I removed the `GetObjectData()` method from the `DicomVR` class, since the class is not defined to implement `ISerializable`, and since the method seemed to do an incomplete part of the required serialization job.

The rationale for making this change is to make the library code more portable (`[DataContract]` and `[DataMember] ` are supported in .NET, Silverlight, WP7 and Windows Store apps whereas `[Serializable]` is only supported in .NET). I hope this pull request is of value to the project as a whole and that it does not break any existing functionality. Otherwise, simply discard it.

Best regards,
Anders @ Cureos