Вопрос

I'm getting some external structures from COM library.

I want to use BinaryFormatter and just get byte array as package. But I need special attribute on structure to satisfy BinaryFormatter.

It's not my structure so how can I handle this situation?

Это было полезно?

Решение

Attributes are metadata class, that are included to the assemply at compile time, So it is impossible to add attiributes to a class dynamically at runtime, check this questions:

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top