Can attributes be added dynamically in C#?

后端 未结 10 824
别跟我提以往
别跟我提以往 2020-11-22 14:32

Is it possible to add attributes at runtime or to change the value of an attribute at runtime?

10条回答
  •  心在旅途
    2020-11-22 14:59

    If you need something to be able to added dynamically, c# attributes aren't the way. Look into storing the data in xml. I recently did a project that i started w/ attributes, but eventually moved to serialization w/ xml.

提交回复
热议问题