Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法向现有图像添加新属性?
我想设置自己的ID 属性以供以后参考。
您可以使用Tag属性来存储任何对象类型。
如果我理解您的问题,那么这就是面向对象编程的全部意义所在。
Class ExtendedImage : Image { public IDtype ID { get; private set; } public ExtendedImage(IDtype ID) { this.ID = ID; } }