是将 Model_1 描述添加到所有类的编程实践,还是特定于UI元素?
例如,我在Docs女士上找到了这段代码。
Model_1
[Description("Represents a custom button control that responds to a Click event. Displays an image using a custom Source property if the Source property is bound to an Image in the template.")]
public class ImageButton : Button
和?有什么不同?
Model_2
/// <summary>
///Represents a custom button control that responds to a Click event. Displays an image using a custom Source property if the Source property is bound to an Image in the template.
///</summary>
public class ImageButton : Button
在哪里正确地同时使用或 Model_1 描述?
发布于 2022-01-05 20:56:06
首先,您的代码应该足够干净,以避免使用它。为什么?因为你必须支持维护评论,而开发人员通常会忽略这一点。描述应该用于通过nuget交付的接口,以便于使用。第二个描述变体更好,因为您不需要包含任何名称空间。
https://stackoverflow.com/questions/70595917
复制相似问题